package
Convert Windows backslash paths to slash paths
npm install slashGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
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.
This was created since the path methods in Node.js outputs \\ paths on Windows.
npm install slashimport 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/barType: string
Accepts a Windows backslash path and returns a path with forward slashes.
Estimated unpacked size across 1 packages.
3.2 kB
Includes dependencies.