url-path-name
Package that shows path info in an easy to use object
Installation
npm i url-path-info --save-dev
Usage
Just require the url-path-info
module.
const pathInfo = ; ; // => Output href: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Mapid?foo=lorem&bar=&baz' protocol: 'https:' host: 'developer.mozilla.org' params: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Mapid?foo': 'lorem' bar: '' baz: '' port: undefined pathname: '/en-US/docs/Web/JavaScript/Reference/Global_Objects/Mapid' search: '?foo=lorem&bar=&baz' hash: ''
Tests
npm test