Convert Windows backslash paths to slash paths:
Forward-slash paths can be used in Windows as long as they're not extended-length paths.
This was created since the
path methods in Node.js outputs
\\ paths on Windows.
npm install slash
import path from 'node: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
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 52,870,789 weekly downloads. As such, slash popularity was classified as popular.
We found that slash demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.