Big news!Introducing Socket AI - ChatGPT-Powered Threat Analysis.Learn more
Socket
Socket

slash

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Issues
File Explorer

Advanced tools

slash

Convert Windows backslash paths to slash paths

    5.1.0latest
    GitHub
    npm

Version published
Maintainers
1
Weekly downloads
65,298,104
increased by8.12%

Weekly downloads

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

Last updated on 09 May 2023

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
Socket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc