usain

A simple task runner tool. Named after the best runner in the world, Usain Bolt.

Introduction

A simple task runner tool. Named after the best runner in the world, Usain Bolt.

Getting started

Using usain is super easy, just follow the steps below.

npm install usain

This is where you define your tasks. This can live in ./build/tasks.js

var spawn = require('child_process').spawn;
var path = require('path');
var bolt = require("../lib/usain");
 
this.tests = function() {
    var jasmineScript = path.join("node_modules", "jasmine-node", "bin", "jasmine-node");
    var specsFolder = path.join("specs");
    return bolt.captureOutput("Tests", spawn("node", [jasmineScript, specsFolder]));
};
this.default = function() { // <== Executed when no arguments provided to runner
    return this.tests();
};

This is where you create your runner. This guy can live in ./usain

var bolt = require("./lib/usain");
bolt.tasks = require("./build/tasks"); // <== This is the module with your tasks
 
bolt.execute(process.argv);

Once configured, you can run usain.

node usain

Or you can specify the tasks you want to run.

node usain tests