WHATWG URL for Node & Browser.
npm install universal-url> WHATWG URL for Node & Browser.
* For Node.js versions >= 8, the native implementation will be used.
* For Node.js versions < 8, a shim will be used.
* For web browsers without a native implementation, the same shim will be used.
Node.js >= 6 is required. To install, type this at the command line:
``shell`
npm install universal-url
`js
const {URL, URLSearchParams} = require('universal-url');
const url = new URL('http://domain/');
const params = new URLSearchParams('?param=value');
`
Global shim:
`js
require('universal-url').shim();
const url = new URL('http://domain/');
const params = new URLSearchParams('?param=value');
``
The bundled file size of this library can be large for a web browser. If this is a problem, try using universal-url-lite in your build as an alias for this module.
[npm-image]: https://img.shields.io/npm/v/universal-url.svg
[npm-url]: https://npmjs.org/package/universal-url
[travis-image]: https://img.shields.io/travis/stevenvachon/universal-url.svg
[travis-url]: https://travis-ci.org/stevenvachon/universal-url
[greenkeeper-image]: https://badges.greenkeeper.io/stevenvachon/universal-url.svg
[greenkeeper-url]: https://greenkeeper.io/