path-util
v0.3.0
Published
Utility for pathname manipulations
Downloads
6
Maintainers
Readme
path-util
Utility for pathname manipulations
Install
$ npm install --save path-util
Usage
var pathUtil = require('path-util');
var relPath = pathUtil.toRelative('/node/site/../css/style.css', '/node/site');
console.log(relPath);
// => '../css/style.css'
var dir = pathUtil.getDirectory('/node/site/style.css');
console.log(dir);
// => '/node/site'
var ext = pathUtil.getExtension('/node/site/style.css');
console.log(ext);
// => 'css'
// and many more (check the docs or even lib/index.js itself)...
License
MIT © oss6