# express-list-endpoints

> A express package to list all registered endpoints and its verbs

Latest version **7.1.1** (published 2024-11-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install express-list-endpoints
pnpm add express-list-endpoints
yarn add express-list-endpoints
bun add express-list-endpoints
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 7.1.1 |
| Published | 2024-11-20 |
| First published | 2016-01-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=18 |
| Dependencies | 0 |
| Unpacked size | 13.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 183 |
| Maintainers | albertofdzm |
| Keywords | endpoint, endpoints, express, list, ls, methods, middlewares, paths, route, routes, verb, verbs |

## Links

- npm: https://www.npmjs.com/package/express-list-endpoints
- Repository: https://github.com/AlbertoFdzM/express-list-endpoints
- Homepage: https://github.com/AlbertoFdzM/express-list-endpoints#readme
- Issues: https://github.com/AlbertoFdzM/express-list-endpoints/issues
- npm.io page: https://npm.io/package/express-list-endpoints

## 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

- 7.1.1 (latest) — 2024-11-20
- 7.1.0 — 2024-04-07
- 7.0.0 — 2024-04-06
- 6.0.0 — 2021-07-29
- 5.0.0 — 2020-07-13
- 4.0.1 — 2019-05-06
- 4.0.0 — 2018-10-14
- 3.0.1 — 2017-10-25
- 3.0.0 — 2016-12-18
- 2.0.3 — 2016-11-05
- 2.0.0 — 2016-04-24
- 1.1.1 — 2016-04-21
- 1.1.0 — 2016-04-19
- 1.0.1 — 2016-01-18
- 1.0.0 — 2016-01-18
- … 1 more at https://npm.io/package/express-list-endpoints/versions

## README

# Express List Endpoints

> [!IMPORTANT]
> This package only works for express 4.\* versions. It's not compatible with express 5 yet.

[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/AlbertoFdzM/express-list-endpoints/ci.yml?branch=main&logo=github)](https://github.com/AlbertoFdzM/express-list-endpoints/actions/workflows/ci.yml?query=branch%3Amain) [![Codecov Coverage Report](https://img.shields.io/codecov/c/github/AlbertoFdzM/express-list-endpoints/main)](https://codecov.io/github/AlbertoFdzM/express-list-endpoints?branch=main) [![Code Climate Maintainability Report](https://img.shields.io/codeclimate/maintainability/AlbertoFdzM/express-list-endpoints)](https://codeclimate.com/github/AlbertoFdzM/express-list-endpoints/maintainability) [![NPM Downloads](https://img.shields.io/npm/dm/express-list-endpoints)
](https://www.npmjs.com/package/express-list-endpoints) [![NPM License](https://img.shields.io/npm/l/express-list-endpoints)](https://www.npmjs.com/package/express-list-endpoints)

[![NPM Package Page](https://img.shields.io/badge/express--list--endpoints-gray?label=npm&labelColor=c21104)](https://www.npmjs.com/package/express-list-endpoints)

Express endpoint parser to retrieve a list of the passed router with the set verbs.

## Examples of use

```javascript
const express = require("express");
const expressListEndpoints = require("express-list-endpoints");

let app = express();

app
  .route("/")
  .all(function namedMiddleware(req, res) {
    // Handle request
  })
  .get(function (req, res) {
    // Handle request
  })
  .post(function (req, res) {
    // Handle request
  });

app.route("/about").get(function (req, res) {
  // Handle request
});

const endpoints = expressListEndpoints(app);

console.log(endpoints);

/* It omits 'all' handlers.
[
  {
    path: '/',
    methods: [ 'GET', 'POST' ],
    middlewares: [ 'namedMiddleware', 'anonymous', 'anonymous' ]
  },
  {
    path: '/about',
    methods: [ 'GET' ],
    middlewares: [ 'anonymous' ]
  }
]
*/
```

```typescript
import express from "express";
import expressListEndpoints from "express-list-endpoints";

let app = express();

app
  .route("/")
  .all(function namedMiddleware(req, res) {
    // Handle request
  })
  .get(function (req, res) {
    // Handle request
  })
  .post(function (req, res) {
    // Handle request
  });

app.route("/about").get(function (req, res) {
  // Handle request
});

const endpoints = expressListEndpoints(app);

console.log(endpoints);
```

## Arguments

### `app` - Express `app` or `router` instance

Your router instance (`router`) or your app instance (`app`).

_**Note:** Pay attention that before call this script the router or app must have the endpoints registered due to detect them._

## Contributing to express-list-endpoints

### Development

Running test:

```shell
npm test
```

## License

Express List Endpoints is [MIT licensed](./LICENSE).

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