🌜
🌞
canonical-path

canonical-path

v1.0.0

paths that always use forward slashes

npm install canonical-path

README

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

General

License
MIT
Typescript Types
None found
Tree-shakeable
No

Popularity

GitHub Stargazers
8
Community Interest
11
Number of Forks
2

Maintenance

Commits
10/219/2201
Last Commit
Oct 24, 2018
Open Issues
0
Closed Issues
0
Open Pull Requests
0
Closed Pull Requests
0

Versions

Versions Released
10/219/2201
Latest Version Released
Oct 24, 2018
Current Tags
latest1.0.0

Dependencies

Dependencies (0)
Dev Dependencies (1)

Contributors

petebacondarwin
petebacondarwin
Commits: 9