node.url
url paraser for javascript
Installation
$ npm install node.url
Usage
const url = ;const str = "http://user:pass@host.com:8080/p/a/t/h?query=string#hash"; console;console; // Result: protocol: 'http:' slashes: true auth: 'user:pass' host: 'host.com:8080' port: '8080' hostname: 'host.com' hash: '#hash' search: '?query=string' query: 'query=string' pathname: '/p/a/t/h' path: '/p/a/t/h?query=string' href: 'http://user:pass@host.com:8080/p/a/t/h?query=string#hash' params: query: 'string'