Convert Windows backslash paths to slash paths
Weekly downloads
Changelog
https://github.com/sindresorhus/slash/compare/v3.0.0...v4.0.0
Readme
Convert Windows backslash paths to slash paths:
foo\\bar
➔foo/bar
Forward-slash paths can be used in Windows 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.js outputs \\
paths on Windows.
$ npm install slash
import path from 'path';
import slash from 'slash';
const string = path.join('foo', 'bar');
// Unix => foo/bar
// Windows => foo\\bar
slash(string);
// Unix => foo/bar
// Windows => foo/bar
Type: string
Accepts a Windows backslash path and returns a path with forward slashes.
Convert Windows backslash paths to slash paths
The npm package slash receives a total of 45,486,323 weekly downloads. As such, slash popularity was classified as popular.
We found that slash demonstrated a not healthy version release cadence and project activity. It has 1 open source maintainer collaborating on the project.