# get-routes

> get-routes gets all routes from an Express application.

Latest version **2.1.6** (published 2022-03-25) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install get-routes
pnpm add get-routes
yarn add get-routes
bun add get-routes
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.1.6 |
| Published | 2022-03-25 |
| First published | 2016-10-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 16.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | thenativeweb-admin, goloroden, yeldir, nhummel, dotkuro |
| Keywords | routes, express |

## Links

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

## Recent versions

- 2.1.6 (latest) — 2022-03-25
- 2.1.5 — 2021-08-16
- 2.1.4 — 2021-06-10
- 2.1.3 — 2021-06-08
- 2.1.2 — 2021-06-08
- 2.1.1 — 2021-05-10
- 2.1.0 — 2021-04-11
- 2.0.18 — 2021-03-25
- 2.0.17 — 2021-02-22
- 2.0.16 — 2021-01-18
- 2.0.15 — 2021-01-04
- 2.0.14 — 2020-12-28
- 2.0.13 — 2020-11-05
- 2.0.12 — 2020-11-03
- 2.0.11 — 2020-10-30
- … 14 more at https://npm.io/package/get-routes/versions

## README

# get-routes

get-routes gets all routes from an Express application.

## Status

| Category         | Status                                                                                                  |
| ---------------- | ------------------------------------------------------------------------------------------------------- |
| Version          | [![npm](https://img.shields.io/npm/v/get-routes)](https://www.npmjs.com/package/get-routes)             |
| Dependencies     | ![David](https://img.shields.io/david/thenativeweb/get-routes)                                          |
| Dev dependencies | ![David](https://img.shields.io/david/dev/thenativeweb/get-routes)                                      |
| Build            | ![GitHub Actions](https://github.com/thenativeweb/get-routes/workflows/Release/badge.svg?branch=main) |
| License          | ![GitHub](https://img.shields.io/github/license/thenativeweb/get-routes)                                |

## Installation

```shell
$ npm install get-routes
```

## Quick start

First you need to add a reference to get-routes to your application:

```javascript
const { getRoutes } = require('get-routes');
```

If you use TypeScript, use the following code instead:

```typescript
import { getRoutes } from 'get-routes';
```

Then, call the `getRoutes` function with an Express app to get a list of all registered routes:

```javascript
const routes = getRoutes(app);

console.log(routes);
// => {
//      get: [
//        '/articles'
//      ],
//      post: [
//        '/articles/:id'
//      ],
//      ...
//    }
```

## Running quality assurance

To run quality assurance for this module use [roboter](https://www.npmjs.com/package/roboter):

```bash
$ npx roboter
```

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