/examples-js-promises

Example of how to use promises using the q library

Primary LanguageJavaScript

Promises vs Callbacks

npm install

Callbacks

node callbacks.js

This shows an example of chaining calls together using callbacks. This leads to a style called Christmas Tree code because it resembles a christmas tree.

Promises

node promises.js

This shows how to chain calls together using the q library and promises.