path-util

0.3.0 • Public • Published

path-util NPM version Build Status Dependency Status Coverage percentage

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

Package Sidebar

Install

npm i path-util

Weekly Downloads

5

Version

0.3.0

License

MIT

Last publish

Collaborators

  • ossedb