Enide Studio

Generators

2014-01-24 00:00:00 +0000

by Paul Verest

When looking at Koa I stumbled upon installation:

$ npm install koa

To use Koa you must be running node 0.11.9 or higher for generator support, and must run node(1) with the --harmony flag. If you don’t like typing this, add an alias to your shell profile:

alias node='node --harmony'

That lead me to research generators.

And discover great site like http://callbackhell.com/ that advises to

  • Name your functions
  • Keep your code shallow
  • Modularize!

More links :

What are Promises?

Harmony generators and promises for Node.js async fun and profit

http://wiki.ecmascript.org/doku.php?id=harmony:generators#references

https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/1.7

comments powered by Disqus