Node Roundup: 6.1, Scaffoldit, Mixture
You can send your node modules and articles in for review through our contact form or @dailyjs.
Node 6.1
Node 0.6.1 was released a few days ago, which adds improvements to documenation, cluster, and includes a host of bug fixes.
Scaffoldit
Scaffoldit (npm: scaffoldit) by Craig Condon is a scaffolding library that makes it easy to take user input and display data using templates. Templates can be written using mustache, and it has command-line support through Craig’s celeri library.
One of the examples reminds me of skeleton app generators that come with frameworks like Express:
scaffoldit({
input: {
projectName: 'What is your project name?'
},
build: function(ops, next) {
scaffoldit.fromDir(ops, '/path/to/input/dir', '/path/to/output/dir');
},
complete: function() {
//...
}
});
Also worth noting is Tim Caswell’s Step library is used to simplify the internal asynchronous code.
Mixture
Mixture (License: MIT, npm: mixture) is a “heterogeneous cluster task manager” by Daniel Shaw. It can be used to programmatically create a diverse set of forked tasks using a straightforward API:
var mix = require('mixture').mix()
, ioPort = 8880
, nodeId = 0
, i
, workers = [];
// announce data server
mix.task('announce').fork('data.js');
// socket.io instances
var socketio = mix.task('socket.io', { filename: 'app.js' })
for (i = 0; i < count; i++) {
ioPort++;
nodeId++;
workers.push(socketio.fork({ args: [ioPort, nodeId] }));
}
// At some point, workers[n].kill() could be called
Daniel has written an example app that uses the library, called Stock Quote Stream.