Node Roundup: 0.6.6, asyncblock, Introduction to Node Modules, Review19

2011-12-21 00:00:00 +0000 by Alex R. Young

Node 0.6.6

Node 0.6.6 is out, which updates npm, fixes some bugs, and adds pause/resume semantics to
stdin. Node also has a new website that is greener than ever, but
remains clean and features a new corporate-friendly edge.

There's also a post on the official Node blog entitled Growing
by Ryan Dahl that
discusses Windows Azure support:

The overarching goal of the port was to expand our user base to the largest number of developers. Happily, this has paid off in the form of being a first class citizen on Azure.


asyncblock (License: MIT, npm: asyncblock) is a fork of node-green-light. It works like a flow control library combined with

The author compares a 'pure Node' example with his own library's code:

function example(callback){
    var finishedCount = 0;
    var fileContents = [];

    var continuation = function(){
        if(finishedCount < 2){

        fs.writeFile('path3', fileContents[0], function(err) {
            if(err) {
                throw new Error(err);

            fs.readFile('path3', 'utf8', function(err, data){
                console.log('all done');

    fs.readFile('path1', 'utf8', function(err, data) {
        if(err) {
            throw new Error(err);

        fileContents[0] = data;


    fs.readFile('path2', 'utf8', function(err, data) {
        if(err) {
            throw new Error(err);

        fileContents[1] = data;


This is the equivalent source using asyncblock and fibers:

var asyncblock = require('asyncblock');

    fs.readFile('path1', 'utf8', flow.add('first'));
    fs.readFile('path2', 'utf8', flow.add('second'));

    var fileContents = flow.wait();

    fs.writeFile('path3', fileContents.first, flow.add());

    fs.readFile('path3', 'utf8', flow.add());
    var data = flow.wait();

    console.log('all done');

Error handling is addressed by including
flow.errorCallback. There are examples of how to use this
in the project's documentation.

Introduction to Node Modules

Robert Kuzelj has been writing a series of posts about Node modules:

He demonstrates how to make packages, and how to take advantage of npm's
major features.


In other Node-related DailyJS articles I've invited readers to share
their own apps with the community. Review19 by
Srirangan is one such project: a kanban and scrum project management tool.

It's built with Socket.IO to provide a real-time
view of a project, and uses simple agile-inspired records that should be
familiar to users of Jira or Pivotal Tracker.

Sign up is free, so give it a try. The author has a Google Group to
support the community at Review19