API Reference
Bree
A fluent job scheduler for Node.js supporting cron, intervals, dates, and worker threads.
Official Documentation ↗CompatibilityThis documentation covers version
v9. Check the official docs for the latest API surface.Installation
npm
npm install breeMethods
No methods match this filter.
Bree runs jobs in worker threads and exposes events for started, finished, and failed runs.
Key Features
- Cron, interval, and date scheduling
- Worker thread isolation
- Job lifecycle events
Usage Notes
Pin a version and check the official docs for the API surface you depend on before upgrading.
Errors
The following points are quoted verbatim from the official documentation. 来源:https://cdn.jsdelivr.net/gh/breejs/bree@latest/README.md · 取证方式:HTTP GET 官方 README/文档页(HTML 去标签) · 抓取时间:2026-11-07T13:48:34.332Z. Any error type, throw condition or recovery step not stated there is left unspecified; this page does not infer exception classes or return values.
- Set this to false if you do not want to see errors from this operation | | doRootCheck | Boolean | true | Attempts to require the root directory, when jobs is empty or null. (https://cdn.jsdelivr.net/gh/breejs/bree@latest/README.md)
- The callback receives two parameters error and workerMetadata. (https://cdn.jsdelivr.net/gh/breejs/bree@latest/README.md)
- Important note, when this callback is present default error logging will not be executed. (https://cdn.jsdelivr.net/gh/breejs/bree@latest/README.md)
FAQ
- How does Bree differ from node-cron?
- Bree runs each job in a worker thread, isolating failures, and supports intervals, cron, and dates with lifecycle events.
- Where do job files live?
- Bree resolves each job name to a file under root, or takes explicit paths, and instantiates it as a worker.
- How do I test a job?
- Run Bree with worker.workerDataForTest or call the job module directly; the scheduler is thin enough to bypass in unit tests.
Report a problem with this API docOpens a pre-filled issue on GitHub.