co-ware
Ware inspired, easily create your own middleware layer using generators via co.
Examples
var ware = ;var w = ; w;
Print the arguments of input.
var ware = ;var w = ; w;
Handles error.
var ware = ;var w = ; w; // "no!"w; // "yes!"
API
ware()
Create a new list of middleware.
.use(*fun)
Push a middleware fn(GeneratorFunction) onto the list. If the middleware has an arity of one more than the input to run it's an error middleware.
.run(input..., [GeneratorFunction])
Runs the middleware functions with input... and optionally calls callback(GeneratorFunction).
.clear()
Clear the middleware.
License
MIT