universal-url !NPM Versionnpm-imagenpm-url !Build Statustravis-imagetravis-url !Dependency Monitorgreenkeeper-imagegreenkeeper-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.
Installation
Node.js>= 6
is required. To install, type this at the command line:
npm install universal-url
Usage
const {URL, URLSearchParams} = require('universal-url');
const url = new URL('http://domain/');
const params = new URLSearchParams('?param=value');
Global shim:
require('universal-url').shim();
const url = new URL('http://domain/');
const params = new URLSearchParams('?param=value');