# urlparser

> Url parser

Latest version **0.3.9** (published 2013-12-10) · APACHE2_0 license · 0 weekly downloads

## Install

```sh
npm install urlparser
pnpm add urlparser
yarn add urlparser
bun add urlparser
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.9 |
| Published | 2013-12-10 |
| First published | 2013-12-10 |
| Weekly downloads | 0 |
| License | APACHE2_0 |
| TypeScript types | separate (@types/urlparser) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Kaerus |
| Maintainers | kaerus |
| Keywords | url, parse |

## Links

- npm: https://www.npmjs.com/package/urlparser
- Repository: https://github.com/kaerus-component/url
- Issues: https://github.com/kaerus-component/url/issues
- npm.io page: https://npm.io/package/urlparser

## 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

- 0.3.9 (latest) — 2013-12-10

## README

[![Build Status](https://travis-ci.org/kaerus-component/urlparser.png)](https://travis-ci.org/kaerus-component/urlparser)

  - [URL](#url)
  - [Examples:](#examples)
  - [UrlParser()](#urlparser)
  - [ret.host](#rethost)
  - [ret.path](#retpath)
  - [ret.query](#retquery)

## URL

  Provides with an Url parser that deconstructs an url into a managable object and back to a string.
  
## Examples:
   
```js
   url = require('urlparser');
   
   var u = url.parse('http://user:pass@kaerus.com/login?x=42');
   
   u.host.hostname = 'database.kaerus.com'
   u.host.password = 'secret';
   u.host.port = 8529;
   u.query.parts.push('a=13');
   u.toString(); // 'http://user:secret@database.kaerus.com:8529/login?x=42&a=13'
```

## UrlParser()

  @class  UrlParser

## ret.host

  Host attributes
  
```js
   host: {
       protocol: {String}
       username: {String}
       password: {String}
       hostname: {String}
       port: {String}
   }
```

## ret.path

  Path information
  
```js
   path: {
       base: {String} // base path without hash
       name: {String} // file or directory name
       hash: {String} // the #hash part in path
   }
```

## ret.query

  Query parameters
  
```js
   query: {
       parts: {Array}   // query segments ['a=3','x=2'] 
       params: {Object} // query parameters {a:3,x:2}
   }
```

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