Socket
Socket
Sign inDemoInstall

bay-compose

Package Overview
Dependencies
2
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bay-compose

Middleware composition utility for Bay.


Version published
Weekly downloads
4
increased by300%
Maintainers
2
Install size
24.3 kB
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 09 Feb 2018

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc