Skip to content
/ pea Public

Pea is a middleware layer for web, inspired by the connect

License

Notifications You must be signed in to change notification settings

ccbabi/pea

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pea

Build Status

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

About

Pea is a middleware layer for web, inspired by the connect

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published