bigdawg
v0.1.0
Published
Zero-dependency async task runner with dependency ordering.
Readme
bigdawg
A small, zero-dependency async task runner. Declare named tasks and their dependencies; bigdawg validates the graph and runs each task after its prerequisites. ES modules with TypeScript declarations. Requires Node.js 18 or newer.
Install
npm install bigdawgUsage
import { runTasks } from 'bigdawg';
const results = await runTasks([
{ name: 'double', dependsOn: ['number'], run: deps => deps.get('number') * 2 },
{ name: 'number', run: async () => 21 },
]);
console.log(results.get('double')); // 42runTasks(tasks) returns a Promise of a Map containing every task's result.
Each task has a unique, nonempty string name, an optional array of prerequisite
names in dependsOn, and a run(dependencies) function. The function receives a
Map containing only its direct prerequisites' results, and may return a value or
a Promise. Duplicate prerequisites are ignored.
All tasks execute sequentially. Independent tasks follow deterministic discovery order. Missing dependencies, cycles, duplicate names, and malformed tasks reject before any task executes. A task failure rejects with the original error and prevents remaining tasks from running. Completed tasks are not rolled back.
Development and publishing
npm test
npm pack --dry-run
npm login
npm publish --access publicPublishing requires npm authentication and the account's publishing authentication requirements. The registry makes the final decision about name availability.
License
MIT
