Socket
Socket
Sign inDemoInstall

universal-url

Package Overview
Dependencies
6
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    universal-url

WHATWG URL for Node & Browser.


Version published
Weekly downloads
90K
decreased by-26.76%
Maintainers
1
Install size
530 kB
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 28 Nov 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc