# @brillout/url-props

Latest version **0.1.1** (published 2019-07-26) · 0 weekly downloads

## Install

```sh
npm install @brillout/url-props
pnpm add @brillout/url-props
yarn add @brillout/url-props
bun add @brillout/url-props
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2019-07-26 |
| First published | 2019-07-24 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | brillout |

## Links

- npm: https://www.npmjs.com/package/@brillout/url-props
- Repository: https://github.com/brillout/url-props
- Homepage: https://github.com/brillout/url-props#readme
- Issues: https://github.com/brillout/url-props/issues
- npm.io page: https://npm.io/package/@brillout/url-props

## Dependencies (1)

- [@brillout/reassert](https://npm.io/package/@brillout/reassert.md) ^0.1.1

## Recent versions

- 0.1.1 (latest) — 2019-07-26
- 0.1.0 — 2019-07-24

## README

<!---






    WARNING, READ THIS.
    This is a computed file. Do not edit.
    Instead, edit `/readme.template.md` and run `npm run docs` (or `yarn docs`).












    WARNING, READ THIS.
    This is a computed file. Do not edit.
    Instead, edit `/readme.template.md` and run `npm run docs` (or `yarn docs`).












    WARNING, READ THIS.
    This is a computed file. Do not edit.
    Instead, edit `/readme.template.md` and run `npm run docs` (or `yarn docs`).












    WARNING, READ THIS.
    This is a computed file. Do not edit.
    Instead, edit `/readme.template.md` and run `npm run docs` (or `yarn docs`).












    WARNING, READ THIS.
    This is a computed file. Do not edit.
    Instead, edit `/readme.template.md` and run `npm run docs` (or `yarn docs`).






-->
Fully-featured URL parsing.
- Works in Node.js.
- Works in the browser.
- Parses URLs with hostname, e.g. `https://example.org/hello/there`, as well as URLs without origin, e.g. `/hello/there`.
- Parses the query string.
- Pretty logging when doing `console.log(parseUrl('https://example.org/hello/there'))`.

Running

~~~js
// ./example.js

const getUrlProps = require('@brillout/url-props');

console.log(getUrlProps('http://localhost:3000/hi'));
console.log(getUrlProps('hello/there?opt=1#sectionA'));
~~~

prints

~~~js
{
  url: 'http://localhost:3000/hi',
  href: 'http://localhost:3000/hi',
  origin: 'http://localhost:3000',
  protocol: 'http:',
  hostname: 'localhost',
  port: '3000',
  pathname: '/hi',
  query: {},
  queryString: '',
  hash: ''
}
{
  url: 'hello/there?opt=1#sectionA',
  href: null,
  origin: null,
  protocol: null,
  hostname: null,
  port: null,
  pathname: '/hello/there',
  query: { opt: '1' },
  queryString: '?opt=1',
  hash: '#sectionA'
}
~~~

<!---






    WARNING, READ THIS.
    This is a computed file. Do not edit.
    Instead, edit `/readme.template.md` and run `npm run docs` (or `yarn docs`).












    WARNING, READ THIS.
    This is a computed file. Do not edit.
    Instead, edit `/readme.template.md` and run `npm run docs` (or `yarn docs`).












    WARNING, READ THIS.
    This is a computed file. Do not edit.
    Instead, edit `/readme.template.md` and run `npm run docs` (or `yarn docs`).












    WARNING, READ THIS.
    This is a computed file. Do not edit.
    Instead, edit `/readme.template.md` and run `npm run docs` (or `yarn docs`).












    WARNING, READ THIS.
    This is a computed file. Do not edit.
    Instead, edit `/readme.template.md` and run `npm run docs` (or `yarn docs`).






-->

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