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

npmnpm install bree

Methods

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.

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.