JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 90053900
  • Score
    100M100P100Q262959F
  • License MIT

Convert Windows backslash paths to slash paths

Package Exports

  • slash

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (slash) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

slash Build Status

Convert Windows backslash paths to slash paths: foo\\barfoo/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 outputs \\ paths on Windows.

Install

$ npm install --save slash

Usage

var path = require('path');
var slash = require('slash');

var str = path.join('foo', 'bar');
// Unix    => foo/bar
// Windows => foo\\bar

slash(str);
// Unix    => foo/bar
// Windows => foo/bar

API

slash(path)

Type: string

Accepts a Windows backslash path and returns a slash path.

License

MIT © Sindre Sorhus