pea-js
TypeScript icon, indicating that this package has built-in type declarations

0.4.1 • Public • Published

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

Dependencies (0)

    Dev Dependencies (6)

    Package Sidebar

    Install

    npm i pea-js

    Weekly Downloads

    3

    Version

    0.4.1

    License

    MIT

    Last publish

    Collaborators

    • ccbabi