# one-router

> An extremely simple router for firing page-specific javascript when the page first loads.

Latest version **0.0.5** (published 2015-11-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install one-router
pnpm add one-router
yarn add one-router
bun add one-router
```

## 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.0.5 |
| Published | 2015-11-13 |
| First published | 2015-11-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Chris Malven |
| Maintainers | onedesign |
| Keywords | routing, router |

## Links

- npm: https://www.npmjs.com/package/one-router
- Repository: https://github.com/onedesign/one-router
- Issues: https://github.com/onedesign/one-router/issues
- npm.io page: https://npm.io/package/one-router

## Alternatives

- [express-promise-router](https://npm.io/package/express-promise-router.md) — 736.1K weekly downloads
- [next-usequerystate](https://npm.io/package/next-usequerystate.md) — 29.8K weekly downloads
- [@bitkyc08/opencodex](https://npm.io/package/@bitkyc08/opencodex.md) — 4.6K weekly downloads
- [lynkr](https://npm.io/package/lynkr.md) — 575 weekly downloads
- [baremetal.js](https://npm.io/package/baremetal.js.md) — 42 weekly downloads

## Recent versions

- 0.0.5 (latest) — 2015-11-13

## README

# OneRouter

An extremely simple router for firing page-specific javascript when the page first loads. It isn't meant to be used on the server and it isn't meant to be used for single pages apps.

## Usage:

On instantiation, OneRouter expects to receive a route object
with each key as a URL regex and each value as a function to call when
the route regex matches the current URL.

```js
var router = new OneRouter({
    '/$': function() {},
    '/about': function() {},
    '/approach': function() {},
    '/work/(.*)': function() {}
});
```

## Testing:

Run tests on command line with:

```
npm install
npm test
```

## Releasing:

```
git commit -am "Fix some bugs."
bower version 1.x.x
npm version <major | minor | patch>
git push origin master && git push --tags
npm publish
```

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