<commit_before># koa-lowercase-path

Koa middleware that converts path to lowercase if not already.

[![Build Status](https://img.shields.io/travis/vgno/koa-lowercase-path/master.svg?style=flat-square)](http://travis-ci.org/vgno/koa-lowercase-path) [![Coverage Status](https://img.shields.io/coveralls/vgno/koa-lowercase-path/master.svg?style=flat-square)](https://coveralls.io/r/vgno/koa-lowercase-path) [![npm](https://img.shields.io/npm/v/koa-lowercase-path.svg?style=flat-square)](https://www.npmjs.com/package/koa-lowercase-path)

## Installation
```
npm install koa-lowercase-path
```

## API
```js
var koa = require('koa');
var app = koa();
app.use(require('koa-lowercase-path')(opts));
```

* `opts` options object.

### Options

- `defer` - If true, serves after yield next, allowing any downstream middleware to respond first.
- `chained` - If the middleware should continue modifying the url if it detects that a redirect already have been performed. Defaults to `true`.

## Example
```js
var koa = require('koa');
var lowercasePath = require('koa-lowercase-path');

var app = koa();

app.use(lowercasePath());

app.use(function *(){
  this.body = 'Hello World';
});

app.listen(3000);
```<commit_msg>docs: Update README for Koa 2<commit_after># koa-lowercase-path

Koa middleware that converts path to lowercase if not already.

**Notice: koa-lowercase-path@2 supports koa@2; if you want to use this module with koa@1, please use koa-lowercase-path@1.**

[![Build Status](https://img.shields.io/travis/vgno/koa-lowercase-path/master.svg?style=flat-square)](http://travis-ci.org/vgno/koa-lowercase-path) [![Coverage Status](https://img.shields.io/coveralls/vgno/koa-lowercase-path/master.svg?style=flat-square)](https://coveralls.io/r/vgno/koa-lowercase-path) [![npm](https://img.shields.io/npm/v/koa-lowercase-path.svg?style=flat-square)](https://www.npmjs.com/package/koa-lowercase-path)

## Installation
```
npm install koa-lowercase-path
```

## API
```js
const Koa = require('koa');
const app = new Koa();
app.use(require('koa-lowercase-path')(opts));
```

* `opts` options object.

### Options

- `defer` - If true, serves after yield next, allowing any downstream middleware to respond first.
- `chained` - If the middleware should continue modifying the url if it detects that a redirect already have been performed. Defaults to `true`.

## Example
```js
const Koa = require('koa');
const lowercasePath = require('koa-lowercase-path');

const app = koa();

app.use(lowercasePath());

app.use(ctx => {
  ctx.body = 'Hello World';
});

app.listen(3000);
```
{'fraction_non_alphanumeric': 0.17482517482517482, 'fraction_numerical': 0.005050505050505051, 'mean_word_length': 4.933179723502304, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 10, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '37121', 'n_tokens_mistral': 949, 'n_tokens_neox': 892, 'n_words': 196}