# pathname-match

> Strip a url to only match the `pathname`.

Latest version **1.2.0** (published 2016-08-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install pathname-match
pnpm add pathname-match
yarn add pathname-match
bun add pathname-match
```

## 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.2.0 |
| Published | 2016-08-28 |
| First published | 2014-12-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Maintainers | yoshuawuyts |
| Keywords | path, match, strip, wayfarer |

## Links

- npm: https://www.npmjs.com/package/pathname-match
- Repository: https://github.com/yoshuawuyts/pathname-match
- Homepage: https://github.com/yoshuawuyts/pathname-match#readme
- Issues: https://github.com/yoshuawuyts/pathname-match/issues
- npm.io page: https://npm.io/package/pathname-match

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

- 1.2.0 (latest) — 2016-08-28
- 1.1.3 — 2016-01-31
- 1.1.2 — 2016-01-23
- 1.1.1 — 2016-01-23
- 1.1.0 — 2015-08-05
- 1.0.0 — 2014-12-23

## README

# pathname-match
[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![Downloads][downloads-image]][downloads-url]

Strip a url to only match the `pathname`. Weighs only 200 bytes gzipped.

## Installation
```bash
$ npm install pathname-match
```

## Usage
```js
const pathMatch = require('pathname-match')
const wayfarer  = require('wayfarer')

const router = wayfarer('/')

router.on('/', => console.log('home'))
router.on('/derp', => console.log('derp'))
router.on('/404', => console.log('not found'))

router.match(pathMatch('/derp/#foo?bin=baz'))
// => '/derp'
```

## Why?
It's meant to feed the output to a router such as [wayfarer][wayfarer], and not
having to worry about hashes in the url. This used to be part of wayfarer, but
has been stripped out to make the api even smaller.

## See Also
- [wayfarer][wayfarer]
- [hash-match](https://github.com/sethvincent/hash-match)

## License
[MIT](https://tldrlegal.com/license/mit-license)

[npm-image]: https://img.shields.io/npm/v/pathname-match.svg?style=flat-square
[npm-url]: https://npmjs.org/package/pathname-match
[travis-image]: https://img.shields.io/travis/yoshuawuyts/pathname-match.svg?style=flat-square
[travis-url]: https://travis-ci.org/yoshuawuyts/pathname-match
[coveralls-image]: https://img.shields.io/coveralls/yoshuawuyts/pathname-match.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/yoshuawuyts/pathname-match?branch=master
[downloads-image]: http://img.shields.io/npm/dm/pathname-match.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/pathname-match

[wayfarer]: https://github.com/yoshuawuyts/wayfarer

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