source: trip-planner-front/node_modules/canonical-path/README.md@ 59329aa

Last change on this file since 59329aa was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 710 bytes
Line 
1# Canonical Path Utility
2
3When writing node.js code that must support Windows and *nix OSes, it is sometimes frustrating
4that path segments are separated differently depending upon the environment.
5
6Ironically, we can pass in paths with either separator and the library will normalize it to the
7current OS's format. But it then returns paths using the current OS's separator.
8
9This utility simple wraps the built-in `path` library such that it only ever returns path segments
10separated by forward slashes (/).
11
12## Installation
13
14```
15npm install --save canonical-path
16```
17
18## Usage
19
20```
21var path = require('canonical-path');
22
23var p = path.normalize('a/b/../c');
24// p === 'a/c';
25```
26
27## Testing
28
29```
30npm test
31```
Note: See TracBrowser for help on using the repository browser.