
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Taskery is a lightweight taskrunner, with a focus on code over configuration.
Taskery is a lightweight taskrunner, with a focus on code over configuration.
npm install taskery --save
To start using taskery, either create a new instance or use the default provided by the module:
// Default instance
var taskery = require('taskery');
// New instance
var Taskery = require('taskery').Taskery;
var taskery = new Taskery();
A task is defined by a name
, its dependencies
and a callback
.
taskery.task('test', ['build'], function() {
// Task execution
});
dependencies
must be an array or undefined
and callback
must
be a function
or undefined
, but at least one of them must be
specified.
The dependencies
array may contain task names or arrays of task
names. Each object in the array is ran sequentially, while the
arrays will themselves be ran in parallel. For example:
task('foo', () => setTimeout(() => console.log('Ran foo'), 500));
task('bar', () => console.log('Ran bar'));
task('foobar', [['foo', 'bar']])
task('foo-bar', ['foo', 'bar'])
If running 'foobar', the expected output is 'Ran bar', then 'Ran foo', while running 'foo-bar', the expected output is 'Ran foo', then 'Ran bar'.
If a task defines a callback that expects zero arguments, taskery assumes that when it returns, the task is done. If, however, asynchronous code is used inside a task, you can specify an argument that will receive a callback function:
taskery.task('asynctask', (done) => {
someAsyncFunction(done);
})
A task may also return a Readable
stream. If it does, the task
is "done" when the stream emits the 'end'
or 'error'
events.
A middleware in taskery is an object with keys mapping to functions that will run on demand. Currently, there are two middleware keys available:
describe(name, description) => void
log(level, message) => void
The describe middleware is called whenever you call .describe()
on a task, and the log
middleware is called when taskery wants
to log something.
For instance, if you are using commander, you can do this to expose your described tasks:
var commander = require('commander');
var tasks = [];
taskery.use({
describe: (name, description) => {
program
.command(name)
.description(description)
.action(() => {
tasks.push(name);
})
}
})
More examples can be seen in tests/index.spec.js
FAQs
Taskery is a lightweight taskrunner, with a focus on code over configuration.
The npm package taskery receives a total of 0 weekly downloads. As such, taskery popularity was classified as not popular.
We found that taskery demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.