# @nichoth/catch-routes

> Listen for route changes and parse urls in the browser

Latest version **1.0.3** (published 2018-09-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install @nichoth/catch-routes
pnpm add @nichoth/catch-routes
yarn add @nichoth/catch-routes
bun add @nichoth/catch-routes
```

## 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.3 |
| Published | 2018-09-05 |
| First published | 2018-07-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 2.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | nichoth |
| Maintainers | nichoth |
| Keywords | browser, route, client-side, parse, url, href, event |

## Links

- npm: https://www.npmjs.com/package/@nichoth/catch-routes
- Repository: https://github.com/nichoth/catch-routes
- Homepage: https://github.com/nichoth/catch-routes#readme
- Issues: https://github.com/nichoth/catch-routes/issues
- npm.io page: https://npm.io/package/@nichoth/catch-routes

## Dependencies (3)

- [url](https://npm.io/package/url.md) ^0.11.0
- [route-event](https://npm.io/package/route-event.md) ^3.0.1
- [querystringify](https://npm.io/package/querystringify.md) ^2.0.0

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2018-09-05
- 1.0.2 — 2018-07-30
- 1.0.1 — 2018-07-30
- 1.0.0 — 2018-07-30

## README

# catch routes
Listen for route changes and parse urls in the browser.

This is a higher level wrapper around [route-event](https://www.npmjs.com/package/route-event) that handles url parsing as well.

## install

    $ npm install @nichoth/catch-routes

## example

```js
var catchRoutes = require('@nichoth/catch-routes')

var { setRoute } = catchRoutes(function onRoute (url) {
    console.log('href', url.href) //  => /some/path?foo=bar
    console.log('pathname', url.pathname) //  => /some/path
    console.log('query', url.query) //  => { foo: 'bar' }
})

// navigate programmatically
setRoute('/hello')
```

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