Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

slash

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Issues
File Explorer

Advanced tools

slash

Convert Windows backslash paths to slash paths

    5.0.0latest

Version published
Maintainers
1
Weekly downloads
58,156,895
increased by4.47%

Weekly downloads

Changelog

Source

Breaking

  • Require Node.js 14 5c5d1d6

Improvements

  • Remove non-ASCII limitation (#20) b83ed2a

https://github.com/sindresorhus/slash/compare/v4.0.0...v5.0.0

Readme

Source

slash

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.

This was created since the path methods in Node.js outputs \\ paths on Windows.

Install

npm install slash

Usage

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

API

slash(path)

Type: string

Accepts a Windows backslash path and returns a path with forward slashes.

Keywords

FAQs

What is slash?

Convert Windows backslash paths to slash paths

Is slash popular?

The npm package slash receives a total of 48,888,155 weekly downloads. As such, slash popularity was classified as popular.

Is slash well maintained?

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.

Last updated on 27 Sep 2022

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.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc