Jake is a JavaScript build tool and task runner for Node.js, designed to operate similarly to traditional build systems like GNU Make or Ruby's Rake. It is currently at version 12.9.7, with active maintenance and a consistent release cadence to support newer Node.js versions. Key differentiators include defining build tasks in plain JavaScript files (Jakefiles), supporting complex task prerequisites, namespacing for organization, and handling asynchronous task execution. Jake offers synchronous file utilities for common build operations and can be installed globally as a CLI, locally as a dev dependency, or embedded programmatically within other applications. It has a long history in the Node.js ecosystem, indicating a mature and well-tested codebase.
npm install jakeVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to define tasks and namespaces in a `Jakefile.js`, including prerequisites and an asynchronous task, and how to execute them from the command line.
Always use CommonJS `require()` syntax for modules within your `Jakefile.js`. For core Jake API, prefer destructuring `require('jake')` or relying on globals if implicitly available in your specific Jake setup.Update your Node.js runtime to version 10 or newer. Refer to Jake's `package.json` for the exact minimum Node.js requirement.
For any task involving asynchronous operations (e.g., `setTimeout`, `jake.exec` with callbacks, Promises), define it as `task('myTask', { async: true }, function () { /* ... async work ... */ this.complete(); });`.Consider installing Jake locally as a development dependency (`npm install --save-dev jake`) and invoking it using `npx jake [task]` from your project's root. If installing globally, ensure your system's PATH variable is correctly configured.
Use `Task['my:task'].reenable()` before calling `Task['my:task'].invoke()` if the task needs to execute more than once within a single Jake run.
Install Jake globally (`npm install -g jake`) and ensure npm's global bin directory is in your system PATH, or install it locally (`npm install --save-dev jake`) and run tasks using `npx jake [taskName]`.
Refactor the `Jakefile.js` and any directly loaded modules to use CommonJS `require()` syntax instead of ESM `import`. Jakefiles inherently run in a CJS context.
Verify the task name spelling, ensure the `Jakefile.js` is in the current directory or specified with `-f`, and check the `Jakefile.js` for JavaScript syntax errors. Use `jake -T` to list available tasks.
Ensure all asynchronous tasks explicitly call `this.complete()` after their operations have finished to signal completion to Jake.
No dependency data recorded yet.