The JavaScript blog.


css node modules zip sql

Node Roundup: libuv Status, node-sql, Zipper, Jade and Stylus Updates

Posted on .

You can send your node modules and articles in for review through our [contact form](/contact.html) or [@dailyjs](http://twitter.com/dailyjs).

libuv Status Report

Ryan Dahl posted a status report for
to the
Node blog, and described some of the background to libuv and reviewed
the features implemented so far. This includes non-blocking TCP sockets
(using IOCP in Windows), non-blocking named pipes, UDP, timers, child process spawning, asynchronous DNS, asynchronous file APIs, and more.
They're currently working on file system events (using inotify, kqueue,
and event ports), a VT100 TTY, and socket sharing between processes.

Ryan also linked to some interesting projects built with libuv, and this
includes Mozilla's Rust which is billed as
a low-level concurrent language.


node-sql (npm: sql) by Brian Carlson (the author of
node-postgres, better known as pg) builds strings of SQL using a simple API. It uses
the kind of chained API that suits this kind of problem:

var sql = require('sql')
  , user
  , query;

user = sql.define({
  name: 'user',
  columns: ['id', 'email', 'lastLogin']

query = user.select(user.id, user.email)
            .where(user.lastLogin.lt(new Date()));

It's still a major work in progress, but I think it could lead to some
extremely interesting database APIs in the future.


Zipper (GitHub: rubenv / zipper, npm: zipper, License: BSD) by Ruben Vermeersch is a zip file creator with an extremely easy API:

var zipper = require('zipper').Zipper
  , zipfile;

zipfile = new zipper('file.zip');
zipfile.addFile('image.jpg', 'path/image.jpg', function(err) {

Jade and Stylus Updates

Jade and Stylus have been updated
to 0.16.0. Jade's grammar has been extended to include literal support
for if, unless, while,
until, and it also supports assignment. This means that
rather than using JavaScript, it's now possible to use declarative

// Old:
- if (!(foo && bar))
 p stuff

// New:
unless foo && bar
  p stuff

This demonstrates the unless keyword, and the new Jade

The other major feature is template inheritance. The keywords
extends and block allow templates to be
inherited from, and "blocks" of markup grouped together and overridden
as required.