{"id":16348481,"url":"https://github.com/tivac/dullard","last_synced_at":"2025-10-26T02:30:32.058Z","repository":{"id":57217029,"uuid":"10957960","full_name":"tivac/dullard","owner":"tivac","description":"Simple, straight-forward NodeJS-powered task runner","archived":false,"fork":false,"pushed_at":"2024-11-28T00:26:47.000Z","size":329,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-08T19:11:55.649Z","etag":null,"topics":["build-automation","build-pipelines","cli","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tivac.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-26T04:10:39.000Z","updated_at":"2024-11-28T00:26:52.000Z","dependencies_parsed_at":"2022-08-28T21:40:21.033Z","dependency_job_id":null,"html_url":"https://github.com/tivac/dullard","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tivac%2Fdullard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tivac%2Fdullard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tivac%2Fdullard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tivac%2Fdullard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tivac","download_url":"https://codeload.github.com/tivac/dullard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238241453,"owners_count":19439768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build-automation","build-pipelines","cli","javascript"],"created_at":"2024-10-11T00:52:23.635Z","updated_at":"2025-10-26T02:30:26.764Z","avatar_url":"https://github.com/tivac.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Dullard [![NPM Version](https://img.shields.io/npm/v/dullard.svg)](https://www.npmjs.com/package/dullard) [![NPM License](https://img.shields.io/npm/l/dullard.svg)](https://www.npmjs.com/package/dullard)\n=======\n[![NPM Downloads](https://img.shields.io/npm/dm/dullard.svg)](https://www.npmjs.com/package/dullard)\n[![Build Status](https://img.shields.io/travis/tivac/dullard.svg)](https://travis-ci.org/tivac/dullard)\n[![Dependency Status](https://img.shields.io/david/tivac/dullard.svg)](https://david-dm.org/tivac/dullard)\n[![devDependency Status](https://img.shields.io/david/dev/tivac/dullard.svg)](https://david-dm.org/tivac/dullard#info=devDependencies)\n\n\u003e \"I have made this longer than usual because I have not had time to make it shorter.\" - Blaise Pascal\n\nDullard 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.\n\n**Table of Contents**\n\n- [Usage](#usage)\n- [Config](#config)\n    - [Examples](#examples)\n        - [JSON](#json)\n        - [Javascript](#javascript)\n    - [Properties](#properties)\n        - [dirs](#dirs)\n        - [steps](#steps)\n        - [includes](#includes)\n    - [Customizing Config Values](#customizing-config-values)\n- [Tasks](#tasks)\n    - [Sync Tasks](#sync-tasks)\n    - [Async Tasks](#async-tasks)\n    - [Logging in a task](#logging-in-a-task)\n- [Install](#install)\n- [Develop](#develop)\n\n## Usage ##\n\n```\n$ dullard --help\n    \n  Let the computers do the boring stuff.\n\n  Usage\n      $ dullard \u003coptions\u003e \u003ctask\u003e, ..., \u003ctaskN\u003e\n\n  Options\n      --help         Show this help\n      --dirs,    -d  Specify directories to load tasks from\n      --list,    -l  Show a list of available tasks\n      --config,  -c  Output final assembled config for debugging\n      --silent,  -s  No output\n      --verbose, -v  Verbose logging\n      --silly,   -y  REALLY verbose logging\n      --log,     -g  Specify log level, one of silly, verbose, info, warn, error, \u0026 silent\n```\n\n## Config ##\n\nDullard will look for a file named `.dullfile` in the current directory or any parent directories \u0026 merge it with the CLI options. It will merge all found results in the current branch of the directory tree with precedence being: `CLI \u003e Local \u003e Parent \u003e ... \u003e Root`.\n\n### Examples ###\n\n#### JSON ####\n\n```javascript\n{\n    \"dirs\" : [\n        \"../../../tasks-a\"\n    ],\n    \n    \"steps\" : [\n        \"fooga\"\n    ]\n}\n```\n\n#### Javascript ####\n\n```javascript\nmodule.exports = {\n    \"dirs\" : [\n        \"../../tasks-a\"\n    ],\n    \n    \"steps\" : {\n        main : [\n            \"fooga\"\n        ],\n        \n        finish : [\n            \"wooga\"\n        ],\n        \n        default : [\n            \"main\",\n            \"finish\"\n        ]\n    }\n};\n```\n\n### Properties ###\n\n#### dirs ####\n`dirs` is an array of directories to load tasks from. Paths are relative to the `.dullfile`.\n\n#### steps ####\n`steps` defines the order of build steps to run. It supports two different formats.\n\n* an array of strings/functions\n* an object containing named step collections that are each an array of strings/functions.\n\nTask names are the names of files in the task directories stripped of their extension or the name of a step collection.\n\n#### includes ###\n`includes` is an array of paths to other `.dullfile`s that will be included \u0026 merged into the existing config. Paths are relative to the `.dullfile`.\n\n```javascript\n{\n    ...\n    \"includes\" : [\n        \"../fooga/wooga/.dullfile\"\n    ]\n}\n```\n\n### Customizing Config Values ###\n\nDullard tries hard to accept whatever \u0026 turn it into something useful. To this end the results of parsing the CLI with [`optimist`](https://github.com/substack/node-optimist) are merged into the config object after all the `.dullfile`s. This allows you to run builds with environment-specific settings easily, as you can override any settings via CLI args.\n\nFor example, given the following `.dullfile` and CLI args\n\n```javascript\n{\n    \"env\" : \"dev\",\n    ...\n}\n```\n\ninvoking dullard using the command `dullard --env=live` will set the `env` value to `\"live\"` instead of `\"dev\"`.\n\nThanks to `optimist`'s ability to handle [dot-notation](https://github.com/substack/node-optimist#dot-notation) for arguments you can also set nested object arguments.\n\n`dullard --env=live --cdn.static=http://www.cdn.com` with the same `.dullfile` as above gives you a `config` object like this\n\n```javascript\n{\n    \"env\" : \"dev\",\n    \"cdn\" : {\n        \"static\" : \"http://www.cdn.com\"\n    }\n    ...\n}\n```\n\n#### Warning ####\nThis only works for values that are __not__ one of Dullard's [CLI options](#usage).\n\n## Tasks ##\n\nTasks are modules that export a single function. There's no wrapper around `fs`, no streams support baked-in, they're a function that can do some stuff. Every task will be passed a shared `config` object that represents the state of dullard \u0026 the tasks to be run. For async tasks you can also accept a second argument that can be used as a callback function following the normal node-style error-first pattern.\n\n\n### Sync Tasks ###\n\n```javascript\n// Passing tasks\nfunction exampleTaskSync(config) {\n    // ...\n}\n\nfunction exampleTaskSync(config) {\n    // ...\n    \n    return undefined;\n}\n\n// Failing tasks\nfunction exampleTaskFailureSync(config) {\n    throw new Error(\"Task failed\");\n}\n```\n\n### Async tasks ###\n\nTasks can do async work in two different ways. Either by accepting a second callback argument, or returning a promise.\n\n```javascript\n// Passing task\nfunction exampleTaskAsyncCallback(config, done) {\n    setTimeout(done, 10);\n}\n\nfunction exampleTaskAsyncPromise(config) {\n    return new Promise(function(reject, resolve) {\n        // ...\n        resolve();\n    });\n}\n\n// Failing task\nfunction exampleTaskFailureAsync(config, done) {\n    done(\"Task Failed\");\n}\n\nfunction exampleTaskFailureAsyncPromise(config) {\n    return new Promise(function(reject, resolve) {\n        // ...\n        reject();\n    });\n}\n```\n\n### Logging in a task ###\n\nDullard makes a `log` function available to tasks via `config.log`, this is a reference to [`npmlog.log()`](https://github.com/npm/npmlog#basic-usage) and you may use it accordingly. It respects log level values passed via the CLI, either via `--log=\u003clevel\u003e` or the shorthand `--verbose` argument.\n\n## Install ##\n\n1. `npm i -g dullard`\n\n## Develop ##\n\n1. `git clone git://github.com/tivac/dullard.git`\n1. `npm i`\n1. Make changes\n1. `npm test`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftivac%2Fdullard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftivac%2Fdullard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftivac%2Fdullard/lists"}