Node Roundup

2010-10-06 00:00:00 +0100 by Alex R. Young

Welcome to the Node Roundup. Send in your apps and libraries using our
contact form or @dailyjs.


Faker.js (MIT License) by Marak Squires can be used in Node or a browser. It allows fake data to be
generated, for testing or rapid prototyping:

var Faker = require('./Faker');
Faker.Name.findName(); // Maximillia Hodkiewicz
Faker.Internet.email(); // Gabriella.Hermann@bartholome.co.uk

There's a demo showing the types of
data the library can generate.

I like using libraries like this with factories for quickly writing
tests (yes, I'm that lazy!)


Nodestream released through LearnBoost under an MIT License is a library used to connect realtime code to templates. It's built on
Jade and Socket.IO and adds a :realtime option to your Jade templates.

The simple example in the documentation demonstrates how to count the
number of people viewing your site:

var connections = 0;
var nodestream = io.listen(app).nodestream()
  .on('connect', function(){
    this.emit('connections', connections);
  .on('disconnect', function(){
    this.emit('connections', connections);


:realtime(repaint: 'connections', local: 'connections')
    - if (connections > 1)
      p #{connections} people are editing right now
    - else
      p You're all alone, loser

The Socket.IO library
(server, client) supports various transports depending on the browser: WebSocket, Flash, forever iframe,
XHR long polling, and XHR multipart encoded. These are abstracted to
look like a WebSocket-like API.


Also from LearnBoost (by TJ Holowaychuk
and Adam Christian) is
Soda, which is a Selenium adapter for Node. This allows you to script browser tests, like this:

  .type('q', 'Hello World')
    if (err) throw err;


Meanwhile, I noticed TJ has released
Lingo, which provides inflection support and other string transformations. For example:

// foxes

// fox

lingo.capitalize('hello there');
// Hello there

There's i18n support and a bunch of other methods.

STDIN Support for Node

While I was looking through Lingo I saw that TJ also wrote a Node patch
to add STDIN
His patch adds - and --stdin flags to the command line arguments. I
didn't realise Node couldn't do this already, which is surprising
because it's pretty important for shell scripts.