Skip to content

Compose an array of middleware into a single function for use in Express, Connect, router, etc

License

Notifications You must be signed in to change notification settings

chentsulin/compose-middleware

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compose Middleware

NPM version NPM downloads Build status Test coverage

Compose an array of middleware into a single function for use in Express, Connect, router, etc.

Installation

npm install compose-middleware --save

Usage

Mostly useful for third-party tooling that needs to generate a middleware function without the overhead of an array. You should probably just use an array.

import express = require('express')
import { compose } from 'compose-middleware'

const app = express()

app.use(compose([
  function (req, res, next) {},
  function (req, res, next) {},
  function (req, res, next) {}
]))

License

MIT

About

Compose an array of middleware into a single function for use in Express, Connect, router, etc

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%