matthewlawson / promise-and-generator-experiments

A very short experiment with examples for using promises and their equivalent generator style

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Various asynchronous techniques in javascript.

Techniques covered

  • Promises
  • Callbacks
  • Generator functions (using co library)
  • EventEmitter

Installing

Install Dependencies

$ npm install

Runing the examples

Promises

$  npm run promise

Callbacks

$  npm run callback

Generators

$  npm run generator

Generators

$  npm run event-emitter

3rd Party libraries

co

Generator based control flow goodness for nodejs and the browser, using promises, letting you write non-blocking code in a nice-ish way.

About

A very short experiment with examples for using promises and their equivalent generator style

License:GNU General Public License v3.0


Languages

Language:JavaScript 100.0%