Socket
Socket
Sign inDemoInstall

dom-urls

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    dom-urls

DOM URLs for Node


Version published
Weekly downloads
84K
decreased by-15.64%
Maintainers
1
Install size
224 kB
Created
Weekly downloads
 

Readme

Source

Node DOM URLs

Build Status Code Climate Analytics

A partial implementation of the W3C URL Spec Draft for Node building on top of URIjs.

If you find incompatibilities, please report them. Error handling is currently very different from the spec.

Browser Polyfills

Installation

npm install dom-urls

Example


var URL = require('dom-urls');

var url = new URL('relative', 'http://example.com/sub/');

url.protocol; // 'http:'
url.hostname; // 'example.com'
url.pathname; // '/sub/relative/'

url.host = 'example.net:8080';
url.port; // '8080'

Why urijs instead of url?

I tried it first, but Node's own URL module doesn't propagate changes, so changing the host doesn't affect the port and vice-versa and I didn't want to reimplement all of that myself.

Keywords

FAQs

Last updated on 13 Oct 2015

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