if-win-backslash
v1.0.1
Published
changes / to \ if the platform is windows
Downloads
1
Maintainers
Readme
name
changes / to \ if the platform is windows
Install
$ npm install if-win-backslash
Usage
const ifwinb = require("if-win-backslash");
let path = ifwinb("your/path/to/something")
// if on windows path = your\\path\\to\\something
// on everything else = your/path/to/something
Text
API
ifwinb(path)
Returns a String
path, if on windows with backslashes,
on everything else with frontslashes.Also normalizes the path using upath
path
Type: string
Path can contain as many front and backslashes as you want
Related
- is-windows - Returns true if the platform is Windows.
License
MIT © Julian Beck