Take the tour ×  From what I have understood there are three
ways of calling asynchronous code:    1. Events: eg.
request.on("event"), callback);   2. Callbacks: eg.
fs.open(path, flags, mode, callback);   3. Promises  I found a
promise library https://github.com/kriszyp/node-promise but I
can't get it.  Could someone explain what promises are all about
and why I should use it?  Also, why was it removed from Node.js?
share|improve this question add comment  6 Answers  up vote 47
down vote accepted  Promises in node.js promised to do some work
and then had separate callbacks that would be executed for
success and failure as well as handling timeouts. Another way to
think of promises in node.js was that they were emitters that
could emit only two events: success and error.  The cool thing
about promises is you can combine them into dependency chains
(do Promise C only when Promise A and Promise B complete).  By
removing them from the core node.js, it created possibility of
building up modules with different im