universal-url
WHATWG URL for Node & Browser.
Last updated 7 years ago by stevenvachon .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install universal-url 
SYNC missed versions from official npm registry.

universal-url NPM Version Build Status Dependency Monitor

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');

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.

Current Tags

  • 2.0.0                                ...           latest (7 years ago)

4 Versions

  • 2.0.0                                ...           7 years ago
  • 1.0.1                                ...           8 years ago
  • 1.0.0                                ...           9 years ago
  • 1.0.0-alpha                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (11)
Dependents (2)

Copyright 2013 - present © cnpmjs.org | Home |