JSPM

slash-path

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

This library wraps the routes library and exposes the same methods with the slash method, to use slash as the default separator.

Package Exports

  • slash-path

Readme

slash-path

Motivation

It's good or bad practice, but we need to compose file paths uniformly, I need to ignore Windows backslash and adopt Linux forward slash to compose paths to system files and resources.

Description

This library wraps the routes library and exposes the same methods with the slash method, to use slash as the default separator.

Example

// import path from "path";
import path from "slash-path";

const filePath = path.resolve('./file.txt')

console.log('path: ', filePath);
// output
// path: c:/path/to/ptoject/file.txt