# dom-urls

> DOM URLs for Node

Latest version **1.1.0** (published 2015-10-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install dom-urls
pnpm add dom-urls
yarn add dom-urls
bun add dom-urls
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2015-10-13 |
| First published | 2014-01-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | Pascal Hartig |
| Maintainers | passy |
| Keywords | dom, url, urls |

## Links

- npm: https://www.npmjs.com/package/dom-urls
- Repository: https://github.com/passy/node-dom-urls
- Homepage: https://github.com/passy/node-dom-urls#readme
- Issues: https://github.com/passy/node-dom-urls/issues
- npm.io page: https://npm.io/package/dom-urls

## Dependencies (1)

- [urijs](https://npm.io/package/urijs.md) ^1.16.1

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2015-10-13
- 1.0.0 — 2015-06-04
- 0.1.1 — 2014-01-14
- 0.1.0 — 2014-01-06

## README

Node DOM URLs
=============

[![Build Status](https://travis-ci.org/passy/node-dom-urls.png)](https://travis-ci.org/passy/node-dom-urls)
[![Code Climate](https://codeclimate.com/github/passy/node-dom-urls.png)](https://codeclimate.com/github/passy/node-dom-urls)
[![Analytics](https://ga-beacon.appspot.com/UA-587894-18/node-dom-urls/readme)](https://github.com/igrigorik/ga-beacon)

A partial implementation of the [W3C URL Spec Draft](https://dvcs.w3.org/hg/url/raw-file/tip/Overview.html) for Node building on top of [URIjs](http://medialize.github.io/URI.js/).

If you find incompatibilities, please [report them](https://github.com/passy/node-dom-urls/issues). Error handling is currently very different from the spec.

Browser Polyfills
-----------------

  - [Joshua Bell's Polyfill](https://github.com/inexorabletash/polyfill/blob/master/url.js)
  - [Eric Arvidsson's Polyfill](https://github.com/arv/DOM-URL-Polyfill)

Installation
------------

`npm install dom-urls`

Example
-------

```js

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.

---
_Source: https://npm.io/package/dom-urls · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
