Node Roundup: Scalable Network Programs, tap, Gittyup

05 Oct 2011 | By Alex Young | Tags node modules essays deployment

You can send your node modules and articles in for review through our contact form or @dailyjs.

An Easy Way to Build Scalable Network Programs

An Easy Way to Build Scalable Network Programs is a short essay by Ryan Dahl, that helps address some recent criticism of Node:

Node has a clear purpose: provide an easy way to build scalable network programs. It is not a tool for every problem. Do not write a ray tracer with Node. Do not write a web browser with Node. Do however reach for Node if tasked with writing a DNS server, DHCP server, or even a video encoding server.

I’ve noticed several high-profile Node developers say similar things recently, even before the community at large was attacked by certain readers of sites like Hacker News and Reddit. What summed it up for me was this tweet by TJ Holowaychuk:

I love how rails people keep coming to node, expecting a rails-like framework. Why not just use…. rails?

It’s nice to have options, and we have enough high quality high-level programming languages and libraries to keep everyone happy. Be nice!

tap

tap (License: MIT, npm: tap) by Isaac Z. Schlueter is essentially a collection of packages that forms a TAP-compliant test framework. Presumably the reason Isaac is interested in this is to encourage Node developers to generate machine-consumable test output for use with npm’s npat option.

Using the tap package as a test framework looks a lot like other Node test frameworks — there’s an object passed to each test that can be used to run assertions and call a method that denotes the test has finished (useful for asynchronous testing). I noticed that it uses a slightly different approach to the CommonJS Unit Testing module, but this might be because Isaac’s examples demonstrate testing inline rather than through a test runner.

The best thing about tap is the way it’s been split up into lots of smaller packages. There are currently 8 packages, and each one is based around either generating or consuming TAP streams. That means it’s possible to generate TAP output from existing frameworks, or they could even be sewn together in new ways to form your own Frankenstein’s monster of test frameworks.

Gittyup

Gittyup (npm: gittyup) by Craig Condon is a deployment library aimed at Node. It supports rollback, testing before deployment, and making slugs of apps. It’s based around JavaScript files rather than a configuration language or DSL:

// Deploy from a git repository
gittyup.app('myApp').checkout('git@github.com:crcn/gittyup-test.git', function(err, result) {
});

// Or from a local path
gittyup.app('myApp').checkout('/some/local/path', function(err, result) {

});

blog comments powered by Disqus