# mini-url

> Lightweight isomorphic url parser.

Latest version **2.1.9** (published 2017-10-22) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.9 |
| Published | 2017-10-22 |
| First published | 2017-03-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Dylan Piercey |
| Maintainers | dylanpiercey |
| Keywords | URL, isomorphic, mini, parse, resolve, universal |

## Links

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

## Dependencies (2)

- [get-loc](https://npm.io/package/get-loc.md) ^2.0.6
- [get-win](https://npm.io/package/get-win.md) ^1.0.1

## 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.9 (latest) — 2017-10-22
- 2.1.8 — 2017-10-16
- 2.1.7 — 2017-10-15
- 2.1.5 — 2017-10-14
- 2.1.4 — 2017-10-14
- 2.1.3 — 2017-10-14
- 2.1.2 — 2017-10-14
- 2.1.1 — 2017-10-14
- 2.1.0 — 2017-10-14
- 2.0.3 — 2017-10-12
- 2.0.2 — 2017-10-11
- 2.0.1 — 2017-10-11
- 2.0.0 — 2017-10-11
- 1.6.1 — 2017-03-28
- 1.6.0 — 2017-03-28
- … 13 more at https://npm.io/package/mini-url/versions

## README

<h1 align="center">
  <!-- Logo -->
  <br/>
  Mini-URL
	<br/>

  <!-- Stability -->
  <a href="https://nodejs.org/api/documentation.html#documentation_stability_index">
    <img src="https://img.shields.io/badge/stability-stable-brightgreen.svg" alt="API Stability"/>
  </a>
  <!-- TypeScript -->
  <a href="http://typescriptlang.org">
    <img src="https://img.shields.io/badge/%3C%2F%3E-typescript-blue.svg" alt="TypeScript"/>
  </a>
  <!-- Prettier -->
  <a href="https://github.com/prettier/prettier">
    <img src="https://img.shields.io/badge/styled_with-prettier-ff69b4.svg" alt="Styled with prettier"/>
  </a>
  <!-- Travis build -->
  <a href="https://travis-ci.org/DylanPiercey/mini-url">
  <img src="https://img.shields.io/travis/DylanPiercey/mini-url.svg" alt="Build status"/>
  </a>
  <!-- Coveralls coverage -->
  <a href="https://coveralls.io/github/DylanPiercey/mini-url">
    <img src="https://img.shields.io/coveralls/DylanPiercey/mini-url.svg" alt="Test Coverage"/>
  </a>
  <!-- NPM version -->
  <a href="https://npmjs.org/package/mini-url">
    <img src="https://img.shields.io/npm/v/mini-url.svg" alt="NPM Version"/>
  </a>
  <!-- Downloads -->
  <a href="https://npmjs.org/package/mini-url">
    <img src="https://img.shields.io/npm/dm/mini-url.svg" alt="Downloads"/>
  </a>
  <!-- Size -->
  <a href="https://npmjs.org/package/mini-url">
    <img src="https://img.shields.io/badge/size-1.21kb-green.svg" alt="Browser Bundle Size"/>
  </a>
</h1>

Light weight, universal, URL parser for node and the browser with built in caching.

# Installation

```console
npm install mini-url
```

# Example

```javascript
import { parse, stringify } from 'mini-url'

// Parse a url into an object.
parse('http://host.com:8080/p/a/t/h?query=string#hash')
/* {
    protocol: 'http:',
    host: 'host.com:8080',
    port: '8080',
    hostname: 'host.com',
    hash: '#hash',
    search: '?query=string',
    pathname: '/p/a/t/h',
    href: 'http://host.com:8080/p/a/t/h?query=string#hash'
} */

// Stringify an object into a url string.
stringify({
  protocol: 'http:',
  host: 'host.com:8080',
  hash: '#hash',
  search: '?query=string',
  pathname: '/p/a/t/h'
})
/* http://host.com:8080/p/a/t/h?query=string#hash */
```

### Contributions

* Use `npm test` to build and run tests.

Please feel free to create a PR!

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