1/8/2014 - 8:03 AM

introducing ./task.js, THE new javascript task runner automation framework

introducing ./task.js, THE new javascript task runner automation framework

why ./task.js?

One word: task automation. It's basically zero effort and you can use the ./task.js package manager to handle any repetitive tasks. You can use ./task.js to automate everything with minimum effort.

./task.js provides the structure, order, and authority that you as a developer so desperately crave. ./task.js will also take responsibility for your actions if you need it to. It's what everybody is using now. ./task.js is the new hotness. It's all about ./task.js now, just like that.

This is compared to npm run/bash scripts, which are:

  • scary
  • not cross-platformant for deploying to windows server 2003
  • old news. Nobody uses bash these days.

getting started

To install ./task.js, first install node.js.

Now you'll need to generate some scaffolding for your project.

You can use the following scaffold generator:

#!/usr/bin/env node
var fs = require('fs');
fs.writeFile('task.js', '#!/usr/bin/env node\n', { mode: 0775 });

browser code goes in browser/, stylesheets go in style/, static assets go in static/. You are free to change these directory names to be whatever you want. Just modify the scaffold generator.

Now you can get started writing your ./task.js script. Here is an example script that uses the browserify, watchify, and catw plugins published to the ./task.js plugin repository:

#!/usr/bin/env node

var fs = require('fs');
var browserify = require('browserify');
var watchify = require('watchify');
var catw = require('catw');

var cmd = process.argv[2];
if (cmd === 'build') build({ watch: false })
else if (cmd === 'watch') build({ watch: true })
else usage(1)

function build (opts) {
  var js = ? watchify : browserify;
  var css = catw('style/*.css', { watch: });
  css.on('stream', function (stream) {

function usage (code) {
  console.error('usage: ./task.js { build | watch }');
  if (code) process.exit(code);


To install ./task.js, first install node.js.