# decanat-url

> URL parser utility.

Latest version **0.1.3** (published 2014-06-27) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2014-06-27 |
| First published | 2014-06-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mushex Antaranian |
| Maintainers | antaranian |
| Keywords | url, decanat |

## Links

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

## Dependencies (2)

- [component-type](https://npm.io/package/component-type.md) ^1.0.0
- [decanat-querystring](https://npm.io/package/decanat-querystring.md) ^1.3.2

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

- 0.1.3 (latest) — 2014-06-27
- 0.1.2 — 2014-06-26
- 0.1.1 — 2014-06-26

## README

# url

  url parser.

## Installation

    $ component install component/url

## Example

```js
var url = require('url');
url.parse('http://example.com:3000/store/shoes?sort=desc');
```

yields:

```js
{
  hash: "",
  host: "example.com:3000",
  port: 3000,,
  hostname: "example.com",
  href: "http://example.com:3000/store/shoes?sort=desc",
  auth: null,
  pathname: "/store/shoes",
  protocol: "http:",
  query: "sort=desc",
  search: "?sort=desc"
}
```

## API

### url.parse(string)

  Parse the given url `string`.

### url.isAbsolute(string)

  Check if the given url `string` is absolute (has a scheme specified).

### url.isRelative(string)

  Check if the given url `string` is relative.

### url.isCrossDomain(string)

  Check if the given url `string` is cross-domain.

## Note

  This url "parser" uses an `<a>` tag, this means that when
  a relative url is given, such as "/foo", it becomes relative
  to the current domain / path, because the browser resolves it
  as it normally would.

## License

  MIT

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