These TypeScript scripts demonstrate common Cronbake setups. They live outside the published bundle (package.json only ships the dist/ folder), so they are safe to keep in the repo.
From the project root:
bun installbun run examples/basic.tsThis spawns two in-memory jobs and listens for Ctrl+C to stop them.
bun run examples/persistence.tsThe script writes state to ./.cronbake-state.json, demonstrating persist: true vs. persist: false jobs and await baker.ready().
bun run examples/logging.tsThis demonstrates custom logger support:
- Creating a custom logger with colored output
- Using a global logger for all jobs via Baker
- Overriding the logger per job
- Error logging when jobs fail
Feel free to copy these files or adapt them into your own app bootstrap logic.