pea-js
v0.4.1
Published
Pea is a middleware layer for web, inspired by the connect
Downloads
3
Readme
Pea
Pea is a middleware layer for web, inspired by the connect
Install
$ npm install pea-js
Example
import Pea from 'pea-js'
const ctrl = new Pea([function (next) {
console.log('1')
next()
}])
.use(function (next) {
console.log('2')
// next(new Error('4'))
// throw new Error('4')
next()
})
.use(function (next) {
console.log('3')
next()
})
// error handling
.use(function (err, next) {
console.error(err)
})
.start()
License
MIT