# unroute

> Removes routes from Express Routers via path/method

Latest version **0.0.2** (published 2015-10-28) · ISC license · 0 weekly downloads

## Install

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

## 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.2 |
| Published | 2015-10-28 |
| First published | 2015-10-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jarrett lee |
| Maintainers | chaunax |

## Links

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

## Recent versions

- 0.0.2 (latest) — 2015-10-28
- 0.0.1 — 2015-10-28
- 0.0.5 — 2015-10-28

## README

# Unroute

Unroute unregisters endpoints in Express Routers, identifying them via
their path and method signature.


## Usage
Install via npm:
```
npm install unroute --save
```



```javascript
//If your route is set up for a delete endpoint on /api/test1:
var express = require('express');
var app = express();
var router = express.Router;
router.route('/api/test1')
  .delete((req, res) => { res.json('DELETE'); });

...

//...you can use Unroute to remove that route specifically:
var unroute = require('unroute');
unroute.remove(router, '/api/test1', ['delete']);

//or leave out the methods param to remove entire route:
unroute.remove(router, '/api/test1');


```


## remove(router, path, methods)
 * @param  {Express.Router} router
 * @param  {string} path
 * @param  {array} methods - e.g., ['GET', 'PUT']. Defaults to all methods if null.



## Tests
Tests are written in mocha/chai.expect.

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