projecte_ionic/node_modules/canonical-path
janmaroto b12369cb47 Conexio amb la api 2022-02-09 18:30:03 +01:00
..
.travis.yml Conexio amb la api 2022-02-09 18:30:03 +01:00
LICENSE.md Conexio amb la api 2022-02-09 18:30:03 +01:00
README.md Conexio amb la api 2022-02-09 18:30:03 +01:00
index.d.ts Conexio amb la api 2022-02-09 18:30:03 +01:00
index.js Conexio amb la api 2022-02-09 18:30:03 +01:00
index.spec.js Conexio amb la api 2022-02-09 18:30:03 +01:00
package.json Conexio amb la api 2022-02-09 18:30:03 +01:00
yarn.lock Conexio amb la api 2022-02-09 18:30:03 +01:00

README.md

Canonical Path Utility

When writing node.js code that must support Windows and *nix OSes, it is sometimes frustrating that path segments are separated differently depending upon the environment.

Ironically, we can pass in paths with either separator and the library will normalize it to the current OS's format. But it then returns paths using the current OS's separator.

This utility simple wraps the built-in path library such that it only ever returns path segments separated by forward slashes (/).

Installation

npm install --save canonical-path

Usage

var path = require('canonical-path');

var p = path.normalize('a/b/../c');
// p === 'a/c';

Testing

npm test