# pathetic

> Get values by path-like keys

Latest version **1.0.0** (published 2016-08-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install pathetic
pnpm add pathetic
yarn add pathetic
bun add pathetic
```

## 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.0 |
| Published | 2016-08-25 |
| First published | 2014-01-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Scott Corgan |
| Maintainers | scottcorgan |
| Keywords | path, path-to-regexp, express, connect, route |

## Links

- npm: https://www.npmjs.com/package/pathetic
- Repository: https://github.com/scottcorgan/pathetic
- Homepage: https://github.com/scottcorgan/pathetic#readme
- Issues: https://github.com/scottcorgan/pathetic/issues
- npm.io page: https://npm.io/package/pathetic

## Dependencies (4)

- [clone](https://npm.io/package/clone.md) ~0.1.11
- [merge](https://npm.io/package/merge.md) ~1.1.2
- [zip-object](https://npm.io/package/zip-object.md) ~0.1.0
- [path-to-regexp](https://npm.io/package/path-to-regexp.md) 0.1.x

## 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.0.0 (latest) — 2016-08-25
- 0.3.1 — 2014-05-07
- 0.3.0 — 2014-05-07
- 0.2.0 — 2014-01-29
- 0.1.0 — 2014-01-28

## README

# pathetic

Get values by path-like keys

## Install

```
npm install pathetic --save
```

## Usage

```js
var pathetic = require('pathetic');
var routes = pathetic({
  '/path': {key: 'value'},
  '/user/:id': function (req, res) {
    res.end('GOT IT!')
  }
});

var p = routes('/path'); // OUTPUTS: {key: 'value'}
var userPath = routes('/user/123');

userPath(req, res);
console.log(userPath.params().id == 123);
```

## API

### pathetic(paths)

* `paths` - a key/value object containing the paths as the keys and anything for the values. This returns a method that lets you query against the table with a path. This uses Express-like paths and breaks out the parameters for your as well.


## Run Tests

```
npm install
npm test
```

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