# @types/route-parser

> TypeScript definitions for route-parser

Latest version **0.1.7** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/route-parser
pnpm add @types/route-parser
yarn add @types/route-parser
bun add @types/route-parser
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2023-11-07 |
| First published | 2017-01-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51437 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/route-parser
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/route-parser
- npm.io page: https://npm.io/package/@types/route-parser

## Recent versions

- 0.1.7 (latest) — 2023-11-07
- 0.1.4 (ts3.8) — 2021-12-16
- 0.1.3 (ts2.3) — 2019-05-13
- 0.1.2 (ts2.0) — 2019-02-13
- 0.1.6 — 2023-10-18
- 0.1.5 — 2023-09-27
- 0.1.1 — 2017-08-21
- 0.1.0 — 2017-06-26
- 0.0.0 — 2017-01-20

## README

# Installation
> `npm install --save @types/route-parser`

# Summary
This package contains type definitions for route-parser (https://github.com/rcs/route-parser).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/route-parser.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/route-parser/index.d.ts)
````ts
declare class Route<TParams extends {} = { [i: string]: any }> {
    /**
     * Represents a route
     * @example
     * var route = new Route('/:foo/:bar');
     * @example
     * var route = new Route('/:foo/:bar');
     */
    constructor(spec: string);

    /**
     * Match a path against this route, returning the matched parameters if
     * it matches, false if not.
     * @example
     * var route = new Route('/this/is/my/route')
     * route.match('/this/is/my/route') // -> {}
     * @example
     * var route = new Route('/:one/:two')
     * route.match('/foo/bar/') // -> {one: 'foo', two: 'bar'}
     */
    match(pathname: string): { [k in keyof TParams]: string } | false;

    /**
     * Reverse a route specification to a path, returning false if it can't be
     * fulfilled
     * @example
     * var route = new Route('/:one/:two')
     * route.reverse({one: 'foo', two: 'bar'}) -> '/foo/bar'
     */
    reverse(params: TParams): string | false;
}

declare namespace Route {}
export = Route;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: none

# Credits
These definitions were written by [Ian Ker-Seymer](https://github.com/ianks), and [Bob Buehler](https://github.com/bobbuehler).

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