# extra-url

> A url wrapper that offers more options than the builtin one.

Latest version **2.1.0** (published 2018-12-02) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install extra-url
pnpm add extra-url
yarn add extra-url
bun add extra-url
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2018-12-02 |
| First published | 2018-04-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=7.0 |
| Dependencies | 0 |
| Unpacked size | 22.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | ValentinHacker |
| Maintainers | valentin_h |
| Keywords | url, wrap |

## Links

- npm: https://www.npmjs.com/package/extra-url
- Repository: https://github.com/ValentinHacker/url-extra
- Issues: https://github.com/ValentinHacker/url-extra/issues
- npm.io page: https://npm.io/package/extra-url

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

- 2.1.0 (latest) — 2018-12-02
- 2.0.1-0 (Unstable) — 2018-07-08
- 2.0.0-0 (BETA) — 2018-07-05
- 2.0.1 — 2018-07-08
- 2.0.0 — 2018-07-05
- 1.2.3-0 — 2018-06-30
- 1.2.2 — 2018-05-17
- 1.2.1 — 2018-05-17
- 1.2.1-0 — 2018-04-30
- 1.2.0 — 2018-04-30
- 1.1.4-0 — 2018-04-29
- 1.1.3 — 2018-04-29

## README

# extra-url  
## An extension of the builtin `url` module.  
  
`url.parse('http://user:pass@host.com:8080/p/a/t/h/file.txt?query=string%21#hash', true /* fix? -> fix half-urls */);`  
  
```javascript
/*STANDARD:
┌─────────────────────────────────────────────────────────────────────────────┐
│                                    href                                     │
├──────────┬┬───────────┬─────────────────┬───────────────────────────┬───────┤
│ protocol ││   auth    │      host       │           path            │ hash  │
│          ││           ├──────────┬──────┼──────────┬────────────────┤       │
│          ││           │ hostname │ port │ pathname │     search     │       │
│          ││           │          │      │          ├─┬──────────────┤       │
│          ││           │          │      │          │ │    query     │       │
"  http:   // user:pass @ host.com : 8080   /p/a/t/h  ?  query=string   #hash "
│          ││           │          │      │          │ │              │       │
└──────────┴┴───────────┴──────────┴──────┴──────────┴─┴──────────────┴───────┘
*/ //EXTENDED:
Url {
  hrefraw: 'http://user:pass@host.com:8080/p/a/t/h/file.txt?query=string%21#hash',
  href: 'http://user:pass@host.com:8080/p/a/t/h/file.txt?query=string!#hash',
  protocolfull: 'http://',
  protocolraw: 'http:',
  protocol: 'http',
  auth: 'user:pass',
  autharr: [ 'user', 'pass' ],
  hostfull: 'user:pass@host.com:8080',
  authhost: 'user:pass@host.com',
  host: 'host.com:8080',
  hostname: 'host.com',
  port: '8080',
  pathraw: '/p/a/t/h/file.txt?query=string%21',
  path: '/p/a/t/h/file.txt?query=string!',
  pathnameraw: '/p/a/t/h/file.txt',
  pathname: '/p/a/t/h/file.txt',
  searchraw: '?query=string%21',
  search: '?query=string!',
  querystringraw: 'query=string%21',
  querystring: 'query=string!',
  queryarrrawdeep: [ [ 'query', 'string%21' ] ],
  queryarrraw: [ 'query=string%21' ],
  queryarrdeep: [ [ 'query', 'string!' ] ],
  queryarr: [ 'query=string!' ],
  queryraw: { query: 'string!' },
  query: { query: 'string!' },
  directoryraw: '/p/a/t/h',
  directory: '/p/a/t/h',
  filepureraw: '/file.txt',
  filepure: '/file.txt',
  fileraw: 'file.txt',
  file: 'file.txt',
  filenameraw: 'file',
  filename: 'file',
  extensionfull: '.txt',
  extension: 'txt',
  hashraw: '#hash',
  hash: '#hash',
  hashnameraw: 'hash',
  hashname: 'hash',
  pathobject: 
   { root: '/',
     dir: '/p/a/t/h',
     base: 'file.txt',
     ext: '.txt',
     name: 'file' },
  toString: [Function: toString],
  slashes: true,
  _revoke: [Function: revoke] }
*/
```  
> **By editing one of the properties of the Url object returned by url.parse, the whole object gets rebuilt to adjust on the change!**

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