npm

Need private packages and team management tools?Check out npm Orgs. »

url-path-info

1.0.5 • Public • Published

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 = require('url-path-info');
 
pathInfo('https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Mapid?foo=lorem&bar=&baz');
 
// => 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

install

npm i url-path-info

Downloadsweekly downloads

1

version

1.0.5

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability