Node Roundup: Sequelize 1.0, node-shell, Formaline

2011-06-01 00:00:00 +0100 by Alex R. Young

Sequelize 1.0.0

Sequelize (GitHub: sdepold / sequelize,
License, npm: sequelize) by Sascha Depold has just been updated to version
1.0.0. Sascha has written about the release in Changes in Sequelize

There's a nice new API for chained queries:

new Sequelize.Utils.QueryChainer
  .on('success', function() { });

And changes to the way models are instantiated:

// Before
new Model({attr1: 1, attr2: 2}).save()

// Now
// to first create the instance and save it afterwards or…

// to create it and directly write it to the database

Other changes include:

And plenty more!

If you're interested in Sequelize but haven't tried it before,
www.sequelizejs.com has great documentation to get you started.


node-shell (npm: shell) by David Worms is a module for building shell scripts. It's interesting
because it lifts a lot of concepts straight from Express, particular
"pluggable" modules. It's very similar to working with Express.

This is a cut-down example from the author's documentation:

var shell = require('shell');
var app = new shell.Shell();

app.configure(function() {
        shell: app

    // ... snip

// Command registration
app.cmd('redis keys :pattern', 'Find keys', function(req, res, next){
        app.client = require('redis').createClient();
    app.client.keys(req.params.pattern, function(err, keys){
        if(err){ return res.styles.red(err.message), next(); }
        res.cyan(keys.join('\n')||'no keys');

// Event notification
app.on('redis quit', function(){

If you're a web app developer who hasn't worked with the console before,
node-shell looks like it might be a good way to leapfrog a lot of


Formaline (License: MIT, npm: formaline) by Guglielmo Ferri helps handle form requests and file uploads, complete with connect middleware. It has several interesting

Basic usage looks like this:

var formaline = require('formaline'),
    form = new formaline({});

form.on('filereceived', function(json) {


The resulting json object will contain these properties:

json = {
  hashname: '..',           // <-- 40 HEX SHA1 STRING ( IT IS THE (SHA1) RESULTING HASH OF FILENAME )
  name: '..',               // <-- FILE ORIGINAL NAME
  path: '..',               // <-- FILE PATH
  type: '..',               // <-- MIME TYPE
  size: 217,                // <-- BYTES
  fieldname: '..',          // <-- FILE FIELD NAME
  datasha1sum: '..',        // <-- 40 HEX SHA1 STRING  ( IT IS THE (SHA1) RESULTING HASH OF THE FILE'S DATA )
  lastModifiedDate: '..'    // <-- FILE MTIME