I've recently created something with the same intentions (say goodbye to 
the callback hell), but simpler and based on Fibers.

https://github.com/luciotato/waitfor

Teaser...

What if... Fibers and wait.for where part of node core?

then you can deprecate almost half the functions at: 
http://nodejs.org/api/fs.html (clue: the *Sync* versions)
<https://github.com/luciotato/waitfor#example>Example:

pure node.js:

var fs = require("fs");

fs.readFile('/etc/passwd', function (err, data) {
    if (err) throw err;
    console.log(data);
});

using *wait.for*:

var fs = require("fs"), wait=require('wait.for');
// in a fiber...
console.log(wait.for(fd.readfile,'/etc/passwd'));


On Tuesday, August 13, 2013 6:25:06 PM UTC-3, Michaël Rouges wrote:
>
> See my topic, about the yielded style programming... and say goodbye to 
> the callback hell. ;)
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to