dom-urls
DOM URLs for Node
Last updated 9 years ago by passy .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install dom-urls 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 1.1.0                                ...           latest (9 years ago)

4 Versions

  • 1.1.0                                ...           9 years ago
  • 1.0.0                                ...           9 years ago
  • 0.1.1                                ...           11 years ago
  • 0.1.0                                ...           11 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE