0.1.2 • Published 8 years ago
pathize-url v0.1.2
pathize-url
Parse URL and return it as result of path.parse
Install
$ npm install --save pathize-url
Usage
const pathizeUrl = require('pathize-url');
pathizeUrl('http://ragingwind.me/blogs/assets/profile.png');
//=>
{
root: 'ragingwind.me', // host, hostname
dir: 'blogs/assets', // dir name of pathname, first seperate will be removed
base: 'profile.png', // the last of the path
ext: '.png', // ext of the last of the path
name: 'profile', // the name of the last of the path
url: [Object] // parsed object from url.parse
}
API
pathizeUrl(url)
input
Type: string
URL to parse.
License
MIT © ragingwind