<commit_before># midware [![Build Status](https://travis-ci.org/h2non/midware.svg?branch=master)](https://travis-ci.org/h2non/midware)

midware is a tiny module for creating middleware for any node or browser application. 
Inspired by the middleware pattern by [connect](https://github.com/senchalabs/connect).

It's only ~60 SLOC.

### Example

```js
var use = require('midware')();
var message = {};

use(function(msg, next) {
  // msg === message
  next();
});

use.run(message, function(err) {
  if (err) return console.log(err);
  // finished
});
```

## Installation

### Node

To install mware in a Node application use npm.

```
npm install midware
```

### Browser

```
bower install midware
```

```
component install h2non/midware
```

```
<script src="//cdn.rawgit.com/h2non/midware/0.1.0/midware.js"></script>
```

## Test

To run tests use npm.

```
$ npm install
$ npm test
```

## Documentation

### Basic Usage

Middleware is useful for creating a plugin system or configuring anything within an application. To use mware just require it and make a call to the module.

```js
var mware = require('mware');
var use = mware();
```

This will return a `use` function which when passed a callback will add it a waterfall sequence that will be invoked one after the other whenever the middleware is run.
<commit_msg>feat(version): bump<commit_after># midware [![Build Status](https://travis-ci.org/h2non/midware.svg?branch=master)](https://travis-ci.org/h2non/midware)

midware is a tiny module for creating middleware for any node or browser application. 
Inspired by the middleware pattern by [connect](https://github.com/senchalabs/connect).

It's only ~60 SLOC.

### Example

```js
var use = require('midware')();
var message = {};

use(function(msg, next) {
  // msg === message
  next();
});

use.run(message, function(err) {
  if (err) return console.log(err);
  // finished
});
```

## Installation

### Node

To install mware in a Node application use npm.

```
npm install midware
```

### Browser

```
bower install midware
```

```
component install h2non/midware
```

```
<script src="//cdn.rawgit.com/h2non/midware/0.1.1/midware.js"></script>
```

## Test

To run tests use npm.

```
$ npm install
$ npm test
```

## Documentation

### Basic Usage

Middleware is useful for creating a plugin system or configuring anything within an application. To use mware just require it and make a call to the module.

```js
var mware = require('mware');
var use = mware();
```

This will return a `use` function which when passed a callback will add it a waterfall sequence that will be invoked one after the other whenever the middleware is run.

{'fraction_non_alphanumeric': 0.14312546957175057, 'fraction_numerical': 0.0067618332081141996, 'mean_word_length': 4.160852713178294, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, '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': '1130059', 'n_tokens_mistral': 891, 'n_tokens_neox': 844, 'n_words': 297}