# koa-no-trailing-slash

> Koa middleware that redirects all requests to an URL with a trailing slash to the same URL without it.

Latest version **2.1.0** (published 2017-10-09) · CC0-1.0 license · 0 weekly downloads

## Install

```sh
npm install koa-no-trailing-slash
pnpm add koa-no-trailing-slash
yarn add koa-no-trailing-slash
bun add koa-no-trailing-slash
```

## 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 | 2.1.0 |
| Published | 2017-10-09 |
| First published | 2015-09-19 |
| Weekly downloads | 0 |
| License | CC0-1.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tae Sandoval |
| Maintainers | tae |
| Keywords | koa, url, redirect, trailing, slash |

## Links

- npm: https://www.npmjs.com/package/koa-no-trailing-slash
- Repository: https://github.com/tssm/koa-no-trailing-slash
- Issues: https://github.com/tssm/koa-no-trailing-slash/issues
- npm.io page: https://npm.io/package/koa-no-trailing-slash

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

- 2.1.0 (latest) — 2017-10-09
- 2.0.0 — 2017-04-01
- 1.1.0 — 2015-10-26
- 1.0.3 — 2015-09-21
- 1.0.1 — 2015-09-20
- 1.0.0 — 2015-09-19

## README

[![ComVer](https://img.shields.io/badge/ComVer-compliant-brightgreen.svg)](https://github.com/staltz/comver)

Koa middleware that redirects all requests to an URL with a
trailing slash to the same URL without it, ignoring the query
string (key and value).

# Installation

    npm install koa-no-trailing-slash

# Usage

```javascript
const app = new (require('koa'));
app.use(require('koa-no-trailing-slash')());
app.use(async (ctx, next) => {
   ctx.response.body = 'Did this URL had a trailing slash?';
});
app.listen(8000);
```

# License

[CC0](https://creativecommons.org/publicdomain/zero/1.0/)

# Related middleware

[koa-lowercase-url](https://www.npmjs.com/package/koa-lowercase-url)

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