Answer the question
In order to leave comments, you need to log in
What is Flowy alternative for node.js?
I am using Flowy for flow control in Node.js. Flowy allows you to write readable chain code like this:
Flowy.chain(function(){
_trips.findOne({id:tripId}, this.slot());
_users.findOne({id:userId}, this.slot());
})
.then(function(err, trip, user){
...
})
.fail(function(err){
...
})
Answer the question
In order to leave comments, you need to log in
Right off the bat, this is Q , and Vow (I use it most often, including on the client).
There are also lesser-known then promises and bluebirds.
All this is called Promises (promises) or Promises / A +
This is what promises are about. There are other libraries bit.ly/1putPFj
There is another option for using various libraries for flow control, which also make more or less harmonious code out of mountain noodles.
Incl. async , a simpler but equally efficient wrapper around standard callbacks.
And others: Step , Seq , FuturesJS .
In addition, the standard will sooner or later include the so-called. generators (yield) are part of harmony es6 . There are even developments in this direction such as koajs (a replacement for expressjs ).
They are in the 0.11 branch, but require a flag to run. Of course, there are no guarantees that this will appear in 0.12, but in 0.14 or 0.16 it will appear with a high degree of probability.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question