Node Roundup: Windows Performance Boost, Bricks.js, Commander.js

2011-08-24 00:00:00 +0100 by Alex R. Young
You can send your node modules and articles in for review through our [contact form](/contact.html) or [@dailyjs](http://twitter.com/dailyjs).

Windows Performance Boost

I noticed Ryan Dahl post a link to these Node http_simple
on Twitter:

nodejs v0.5 benchmarks gist.github.com/1166690 (still some work to do on libuv backend but Windows is on par with Linux now!)

This is good news for Windows developers, and again demonstrates the
phenomenal progress we're seeing on libuv.


Bricks.js (GitHub: JerrySievert / bricks, License: MIT/X11,
npm: bricks) by Jerry Sievert is a modular web framework that isn't
built on existing web technology like

The most basic usage example is a static web server:

var bricks = require('bricks');
var appServer = new bricks.appserver();

appServer.addRoute('/static/.+', appServer.plugins.filehandler, { basedir: './static' });
appServer.addRoute('.+', appServer.plugins.fourohfour);
var server appServer.createServer();


Routes can be strings or regular expressions. Routes are grouped into
sections, which are pre, main,
post, and final. Each of these sections are
explained in the Bricks.js

When a function is passed to a route, it gets request,
parameters like Express. Routes can also take plugins,
which can be used to manage state. The routing and error APIs are
event-based. That means it's possible to set up listeners on events like
section completion and errors:

response.on('main.complete', mainCompletion);

// Errors
appserver.addEventHandler('route.fatal', function(error) { console.log('FATAL:', error); });

Bricks.js seems to be quite different to most Node web frameworks, and I
like the fact it's event-based. It seems like the strength of the
framework will come from contributed plugins, so hopefully Jerry will
start some kind of centralised list of plugins as they emerge.


Commander.js (GitHub: visionmedia / commander.js, License:
MIT, npm: commander) by TJ Holowaychuk is a "complete solution" for developing command-line interfaces.

It has a chained API, allowing you to express a command-line application
in terms of options, prompts (including a non-echoing password prompt),
confirmation, and simple menus. This allows command-line help to be
automatically generated.

  .option('-i, --integer ', 'An integer argument', parseInt)
  .option('-f, --float ', 'A float argument', parseFloat)
  .option('-r, --range ..', 'A range', range)
  .option('-l, --list ', 'A list', list)
  .option('-o, --optional [value]', 'An optional value')