# href-type

> Test whether an href string is absolute, relative, protocol-relative, #fragment, mailto:, tel:, sms:, etc

Latest version **1.0.1** (published 2017-05-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install href-type
pnpm add href-type
yarn add href-type
bun add href-type
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-05-02 |
| First published | 2016-01-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | zeke |
| Maintainers | zeke |
| Keywords | href, url, absolute, protocol, relative, mailto, links, anchor, scraping, html |

## Links

- npm: https://www.npmjs.com/package/href-type
- Repository: https://github.com/zeke/href-type
- Homepage: https://github.com/zeke/href-type#readme
- Issues: https://github.com/zeke/href-type/issues
- npm.io page: https://npm.io/package/href-type

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-05-02
- 1.0.0 — 2016-01-02

## README

# href-type

Test whether an href string is absolute, relative, protocol-relative, #fragment, mailto:, tel:, sms:, etc

## Installation

```sh
npm install href-type --save
```

## Usage

```js
const hrefType = require('href-type')

hrefType('mailto:zeke@sikelianos.com')  // mailto
hrefType('tel:+15054592942')            // tel
hrefType('sms:+15054592942')            // sms
hrefType('https://example.com')         // absolute
hrefType('http://example.com')          // absolute
hrefType('irc://irc.example.com')       // protocol
hrefType('/foo/bar.html')               // rooted
hrefType('baz/qux.css')                 // relative
```

## Tests

```sh
npm install
npm test
```

## Dependencies

None

## Dev Dependencies

- [chai](https://github.com/chaijs/chai): BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
- [mocha](https://github.com/mochajs/mocha): simple, flexible, fun test framework


## License

MIT

_Generated by [package-json-to-readme](https://github.com/zeke/package-json-to-readme)_

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