Parse URL and return it as result of path.parse
$ npm install --save pathize-url
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
}
Type: string
URL to parse.
MIT © ragingwind