Automatically load cha and register tasks.
$ npm install cha-load --save-dev
// Manually require cha library.
var cha = require('cha');
// Manually require all tasks.
cha.in('glob', require('task-glob'))
.in('combine', require('task-combine'))
.in('replace', require('task-replace'))
.in('writer', require('task-writer'))
.in('uglifyjs',require('task-uglifyjs'))
.in('copy', require('task-copy'))
.in('request', require('task-request'))
// Now only needs require cha-load
var cha = require('cha-load')();
require('cha-load')();
Equivalent to:
require('cha-load')({pattern: 'task-*'});
You can exclude tasks using the negate !
globbing pattern:
require('cha-load')({pattern: ['task-*', '!task-coffee']});
require('cha-load')({config: '../package'});
require('cha-load')({scope: 'devDependencies'});
require('cha-load')({scope: ['devDependencies', 'dependencies']});
Type: String
, Array
Default: 'task-*'
(globbing pattern)
Type: String
, Object
Default: Path to nearest package.json
Type: String
, Array
Default: ['dependencies', 'devDependencies', 'peerDependencies']
Type: String
Default: 'task-'