Skip to content

Latest commit

 

History

History
57 lines (48 loc) · 1.27 KB

File metadata and controls

57 lines (48 loc) · 1.27 KB

API Class Methods

const Bundl = require('bundl');

cliArgs

Get any of the arguments passed from command line.

$ node mybundl.js --flag --other=stuff
Bundl.cliArgs.flag // true
Bundl.cliArgs.other // "stuff"

load

Load all matched scripts.

Bundl.load('./build/*');

listTasks

List all named tasks that have been defined.

Bundl.listTasks(); // { taskOne: [Function], taskTwo: [Function] }

runTask

Run a named task. Chain a series of tasks using then.

Bundl.runTask('build').then('test');

setTask

Define tasks to be run. A task must return true or call done when it is complete. If hideFromSummary is true the task will be omitted from the summary table when --verbose is used.

const hideFromSummary = true;

Bundl.task('test:unit', function (done) {
    // do unit tests
    done();
}, hideFromSummary);

Bundl.run('test:unit');

shell

Execute shell commands from within your scripts. See execa for advanced usage options.

Bundl.shell('ls', ['-l']);

watch

Monitor files and fire a callback when files have changed. This is a convenience wrapper for node-watch

Bundl.watch(path, onChange, filter)