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.
Installation
Node.js >= 6
is required. To install, type this at the command line:
npm install universal-url
Usage
const URL URLSearchParams = ; const url = 'http://domain/';const params = '?param=value';
Global shim:
; const url = 'http://domain/';const params = '?param=value';
Browserify/etc
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.