mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-06-11 05:11:40 +00:00
update
This commit is contained in:
44
node_modules/slash/readme.md
generated
vendored
Normal file
44
node_modules/slash/readme.md
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
# slash [](https://travis-ci.org/sindresorhus/slash)
|
||||
|
||||
> Convert Windows backslash paths to slash paths: `foo\\bar` ➔ `foo/bar`
|
||||
|
||||
[Forward-slash paths can be used in Windows](http://superuser.com/a/176395/6877) as long as they're not extended-length paths and don't contain any non-ascii characters.
|
||||
|
||||
This was created since the `path` methods in Node outputs `\\` paths on Windows.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
$ npm install --save slash
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var path = require('path');
|
||||
var slash = require('slash');
|
||||
|
||||
var str = path.join('foo', 'bar');
|
||||
// Unix => foo/bar
|
||||
// Windows => foo\\bar
|
||||
|
||||
slash(str);
|
||||
// Unix => foo/bar
|
||||
// Windows => foo/bar
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### slash(path)
|
||||
|
||||
Type: `string`
|
||||
|
||||
Accepts a Windows backslash path and returns a slash path.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
Reference in New Issue
Block a user