# open-url-js

> Simply manage urls.

Latest version **1.0.30** (published 2018-03-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install open-url-js
pnpm add open-url-js
yarn add open-url-js
bun add open-url-js
```

## 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.0.30 |
| Published | 2018-03-18 |
| First published | 2017-12-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 13.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Julien Dargelos |
| Maintainers | juliendargelos |
| Keywords | url, uri |

## Links

- npm: https://www.npmjs.com/package/open-url-js
- Repository: https://www.github.com/juliendargelos/open-url-js
- npm.io page: https://npm.io/package/open-url-js

## Dependencies (2)

- [pathname-js](https://npm.io/package/pathname-js.md) ^1.0.12
- [parameters-js](https://npm.io/package/parameters-js.md) ^1.0.30

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.30 (latest) — 2018-03-18
- 1.0.29 — 2018-03-18
- 1.0.28 — 2018-03-18
- 1.0.27 — 2018-03-18
- 1.0.26 — 2018-02-26
- 1.0.25 — 2017-12-08
- 1.0.24 — 2017-12-05
- 1.0.23 — 2017-12-04
- 1.0.22 — 2017-12-03
- 1.0.21 — 2017-12-03
- 1.0.20 — 2017-12-03
- 1.0.19 — 2017-12-03
- 1.0.18 — 2017-12-03
- 1.0.17 — 2017-12-03
- 1.0.16 — 2017-12-03
- … 16 more at https://npm.io/package/open-url-js/versions

## README

# Open URL JS 🔍
[![npm version](https://badge.fury.io/js/open-url-js.svg)](https://badge.fury.io/js/open-url-js)
[![Maintainability](https://api.codeclimate.com/v1/badges/27a140e4e8a692f19938/maintainability)](https://codeclimate.com/github/juliendargelos/open-url-js/maintainability)

Simply manage urls.

## Install

```
npm install open-url-js
```

## Usage

```javascript
var Url = require('open-url-js');

var url = new Url('https://www.myapp.com:3000/users/:id/#profile?user[lang]=fr');
url;
// => Url {
//      protocol: 'https',
//      host: 'www.myapp.com',
//      port: 3000,
//      path: Pathname ['users', ':id', root: true],
//      hash: 'profile',
//      parameters: Parameters {
//        user: Parameters {
//          lang: fr
//        }
//      }
//    }

url.path.id = 4;
url.string;
// => 'https://www.myapp.com:3000/users/4/#profile?user[lang]=fr';

url.parameters = {
  lang: 'en',
  zone: 'United States'
};
url.string;
// => 'https://www.myapp.com:3000/users/4/#profile?lang=fr&zone=United%20States';
```

<a name="Url"></a>

## Url
**Kind**: global class  

* [Url](#Url)
    * [new Url(...string)](#new_Url_new)
    * [.string](#Url+string) : <code>string</code>
    * [.protocol](#Url+protocol) : <code>string</code>
    * [.host](#Url+host) : <code>string</code>
    * [.port](#Url+port) : <code>string</code>
    * [.hash](#Url+hash) : <code>string</code>
    * [.path](#Url+path) : <code>Pathname</code>
    * [.parameters](#Url+parameters) : <code>Parameters</code>
    * [.clear()](#Url+clear) ⇒ [<code>Url</code>](#Url)
    * [.toString()](#Url+toString) ⇒ <code>string</code>

<a name="new_Url_new"></a>

### new Url(...string)
Create a [Url](#Url) object.


| Param | Type | Description |
| --- | --- | --- |
| ...string | <code>Object</code> | Same value as [string](#Url+string). |

<a name="Url+string"></a>

### url.string : <code>string</code>
A string corresponding to the url. When set, it will be parsed.

**Kind**: instance property of [<code>Url</code>](#Url)  
<a name="Url+protocol"></a>

### url.protocol : <code>string</code>
The protocol of the url.

**Kind**: instance property of [<code>Url</code>](#Url)  
<a name="Url+host"></a>

### url.host : <code>string</code>
The host of the url.

**Kind**: instance property of [<code>Url</code>](#Url)  
<a name="Url+port"></a>

### url.port : <code>string</code>
The port of the url.

**Kind**: instance property of [<code>Url</code>](#Url)  
<a name="Url+hash"></a>

### url.hash : <code>string</code>
The hash of the url.

**Kind**: instance property of [<code>Url</code>](#Url)  
<a name="Url+path"></a>

### url.path : <code>Pathname</code>
The path of the url.

**Kind**: instance property of [<code>Url</code>](#Url)  
<a name="Url+parameters"></a>

### url.parameters : <code>Parameters</code>
The parameters of the url.

**Kind**: instance property of [<code>Url</code>](#Url)  
<a name="Url+clear"></a>

### url.clear() ⇒ [<code>Url</code>](#Url)
Clears the url.

**Kind**: instance method of [<code>Url</code>](#Url)  
**Returns**: [<code>Url</code>](#Url) - Itself.  
<a name="Url+toString"></a>

### url.toString() ⇒ <code>string</code>
**Kind**: instance method of [<code>Url</code>](#Url)  
**Returns**: <code>string</code> - Value of [string](#Url+string).

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