You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

bay-compose

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bay-compose

Middleware composition utility for Bay.

3.0.0
latest
Source
npmnpm
Version published
Weekly downloads
39
1200%
Maintainers
2
Weekly downloads
 
Created
Source

bay-compose

Middleware composition utility for Bay.

NPM version

Like koa-compose@2, but:

  • returns the final value.
  • supports async function.
  • next is a yieldable function, e.g. yield * next equals yield * next().
npm i bay-compose
const compose = require('bay-compose')

compose([
  function * (next) {
    yield next
  },
  function * (next) {
    yield next()
  },
  function * (next) {
    yield * next
  },
  function * (next) {
    yield * next()
  },
  async function (next) {
    await next()
  },
  function (next) {
    next().then(doSomeJob)
  }
])(context)

Keywords

koa

FAQs

Package last updated on 09 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts