Node Roundup: Browserify, NowJS, Vogue

2011-03-30 00:00:00 +0100 by Alex R. Young


Browserify (GitHub: substack / node-browserify) by James
Halliday makes CommonJS packages work in browsers by bundling up modules
into a monolithic file. I know we've had a lot of script loaders on
DailyJS, and detailed discussions about monolithic files vs. loading
scripts on demand, but I assume James has structured Browserify this way
to make the require syntax easy to support.

The package includes Connect middleware:

var connect = require('connect');
var server = connect.createServer();
server.use(require('browserify')(__dirname + '/js'));


The dependency support is interesting as well:

If the npm modules have dependencies, those dependencies will get bundled along recursively!

It's also possible to run modules through minifiers, using post-filters.

I think this must be the most convenient way to share code between Node
and browsers that I've seen so far.

I also seem to remember writing about
Nodules which is similar to this project, and brequire.


NowJS (GitHub: Flotype / now) aims to make real-time applications
easier to develop by synchronising functions and variables in a
namespace between clients and a server.

It can be set up with an Express app like this:

var app = express.createServer();
var everyone = require("now").initialize(app);

The authors have already written a NowJS Coding Patterns and Best
guide, which explains how to
filter messages at the client-side (for creating rooms in a chat
application), and tips for keeping things efficient.


Vogue (GitHub: andrewdavey / vogue,
License) by Andrew Davey automatically reloads stylesheets whenever they're
saved. It uses Socket.IO so it feels pretty
responsive. It's a great idea for use during development, and I imagine
it would blow your design team's collective minds.