Skip to content
Simple, straight-forward NodeJS-powered task runner
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Dullard NPM Version NPM License

NPM Downloads Build Status Dependency Status devDependency Status

"I have made this longer than usual because I have not had time to make it shorter." - Blaise Pascal

Dullard is a simple NodeJS-powered task runner. It exists because doing the same thing repeatedly is boring. Much better to let the computer do it instead.

Table of Contents


>dullard --help
dullard v0.4.3
    Let the computers do the boring stuff.

Usage: dullard -d <dir>,...,<dirN> <step1> ... <stepN>

  --help, -?     Show usage
  --dirs, -d     directories to load task files from
  --list, -l     List available tasks
  --quiet, -q    Minimal output
  --verbose, -v  Verbose logging
  --loglevel     Chattiness, one of: silly, verbose, info, warn, error, & silent  [default: "info"]
  --silent       No output until something goes awry


Dullard will look for a file named .dullfile in the current directory or any parent directories & merge it with the CLI options. It will merge all found results in the current branch of the directory tree with precedence being: CLI > Local > Parent > ... > Root.



    "dirs" : [

    "steps" : [


module.exports = {
    "dirs" : [

    "steps" : {
        main : [

        finish : [

        default : [



dirs is an array of directories to load tasks from. Paths are relative to the .dullfile.


steps defines the order of build steps to run. It supports two different formats.

  • an array of strings/functions
  • an object containing named step collections that are each an array of strings/functions.

Task names are the names of files in the task directories stripped of their extension or the name of a step collection.


includes is an array of paths to other .dullfiles that will be included & merged into the existing config. Paths are relative to the .dullfile.

    "includes" : [

Customizing Config Values

Dullard tries hard to accept whatever & turn it into something useful. To this end the results of parsing the CLI with optimist are merged into the config object after all the .dullfiles. This allows you to run builds with environment-specific settings easily, as you can override any settings via CLI args.

For example, given the following .dullfile and CLI args

    "env" : "dev",

invoking dullard using the command dullard --env=live will set the env value to "live" instead of "dev".

Thanks to optimist's ability to handle dot-notation for arguments you can also set nested object arguments.

dullard --env=live --cdn.static= with the same .dullfile as above gives you a config object like this

    "env" : "dev",
    "cdn" : {
        "static" : ""


This only works for values that are not one of Dullard's CLI options.


Tasks are simple modules that should export a single function. Each task function gets passed two arguments, a shared config object for state in the task chain & an optional callback for async tasks. The callback takes two possible arguments, an error object and an optional object to replace the shared config object. If the task is synchronous any return value will be considered an error.

// Passing tasks
function exampleTaskSync(config) {

function exampleTaskAsync(config, done) {


// Failing tasks
function exampleTaskFailureSync(config) {
    return "Task failed";

function exampleTaskFailureAsync(config, done) {
    done("Task Failed");

Logging in a task

Dullard makes a log function available to tasks via config.log, this is a reference to npmlog.log() and you may use it accordingly. It respects loglevel values passed via the CLI, either via --loglevel=<level> or the shorthand --verbose argument.


  1. npm i -g dullard


  1. git clone git://
  2. npm i
  3. Make changes
  4. npm test


Q: What about file watching?

A: Nothing built-in yet, still trying to figure out if I'm comfortable with cluttering up the .dullfile(s) with watcher config stuff. For now check out this gist.

Something went wrong with that request. Please try again.