Node Roundup: Node 0.4.1, Weld, Cluster

Alex R. Young





server templates node

Node Roundup: Node 0.4.1, Weld, Cluster

Posted by Alex R. Young on .

server templates node

Node Roundup: Node 0.4.1, Weld, Cluster

Posted by Alex R. Young on .

Node 0.4.1

Node 0.4.1
has been released. This version updates V8 to 3.1.5, and includes fixes
for HTTPS, Cygwin, and more.

Download Node 0.4.1 here, or read the documentation.

If you ever want to view older API documentation and can't find it
locally, you can view a list at


Weld by Elijah Insua and hij1nx is a library for turning data into markup. It works with both Node and

To get your head around how it works, consider this HTML:

    Hello my name is My Name
    Leet Developer

We want to add values to the elements represented by the
.name and .firstAndLast selectors. The data we
have looks like this:

var data = [{ name: 'hij1nx',  title: 'code exploder' },
            { name: 'tmpvar', title: 'code pimp' }];

Weld can map this data to the HTML like this:

weld('.contact', data, { bind: { 'name': '.firstAndLast', 'title': '.title' } });

The first parameter is the container selector, and the third parameter
helps Weld map the data to the HTML.


In the comments for Node Tutorial
, Johan Steenkamp
had loads of tips for deploying Node apps to Amazon EC2. I've also been
playing with this lately, and I thought I'd try
Cluster (MIT License) by TJ Holowaychuk. Cluster is a multi-core server manager. It'll work with
Node 0.2.x, but it's a bit more convenient to use it with 0.4.x.

If you've used Spark before, then
you should be fairly comfortable with Cluster. If not, Cluster is a tool
for managing Node servers and utilizing multi-core systems. It provides
features that make managing your servers more seamless -- reload workers
when files change, zero-downtime reload, and even a repl for real-time

All you need to do is call Cluster where you'd usually set up a server
to listen on a port.

This is an Express app set up to use Cluster:

var app = require('express').createServer(),
    cluster = require('cluster');

app.get('/', function(req, res){
  res.send('hello world');


More examples can be found in the Cluster