if-win-backslash

1.0.1 • Public • Published

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

Package Sidebar

Install

npm i if-win-backslash

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

3.07 kB

Total Files

4

Last publish

Collaborators

  • jufabeck2202