promise-knit
When you have a fix set of input and fix set of consumer functions for that input you end up in nesting functions, handling the state of the output. I created Knit to make my code look much readable and manageable.
Usage
/* input = Array consumers = Function or Array of Functions outputStub (optional) = An initial Output value chain = Boolean, chain output of a consumer as input for the next consumer*/Promise
Example
Simple consumer
var input = 1 2 1 2 1 4 1 2 6var outputStub = numberOfOne: 0 numberOfTwo: 0 { return { if val === 1 ++outputnumberOfOne; return }} { return { if val === 2 ++outputnumberOfTwo; return }} Promise
Chain Outputs
var Users = mongoose { return { Users }} { return { Users }} app