The most straightforward co-routine library for Node.JS ever.
Provides predictable composable
async/await from C#5.0 style
co-routines for everyday use since you can live in a Harmony.
Inspired by @ForbesLindesay's great presentation: http://pag.forbeslindesay.co.uk/#/
co-4.0 that was rewritten to use promises,
so-1.0 can be compared with
and represents its more light and strict version.
When using node 0.11.x or greater, you must use the
flag or just
--harmony to get access to generators.
Also as of
so-1.0 you should ensure existence of Promise either by using
--harmony or any available polyfill.
$ npm install so
var so = ;var fs = ;var readJSON =;var main =;;
or for CoffeeScript
so = require 'so'fs = require 'then-fs'readJSON = soJSONparse yield fsreadFile path'utf8'main = so ->a = yield readJSON 'a.json'b = yield readJSON 'b.json'consolelog abmaincatchconsolelog estack ? emessage ? e