1.0.1 • Published 6 years ago

if-win-backslash v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

name Build Status

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