Package Exports
- slash-path
- slash-path/dist/index.cjs
- slash-path/dist/index.js
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-path) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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