4 ms·
Promises are definitely gone. The pattern now is that functions taking a callback always take it as the last parameter. The callback always has an error argumen
by grayrest 16y ago
Promises are definitely gone. The pattern now is that functions taking a callback always take it as the last parameter. The callback always has an error argument as its first parameter.
Since the pattern is predictable, it's easy to write a higher level wrapper around it. I like Kris Kowal's Q promises [1] for most things and Tim Caswell's Do [2] for simple sequencing (a la shell scripts).
[1] http://github.com/kriskowal/q/blob/master/q.js http://github.com/kriskowal/q/blob/master/q.js
[2] http://howtonode.org/do-it-fast http://howtonode.org/do-it-fast