Decoratorsv0.1.3
@tekir/cron-decorators
Cron job decorators for scheduling methods.
Installation
$
bun add @tekir/cron-decoratorsFeatures
- @CronJob class decorator for job registration
- @Schedule('* * * * *') for cron expressions
- @Every('5m') for simple interval syntax
- Metadata collection for auto-registration
Quick Example
TypeScript
import { CronJob, Schedule, Every } from '@tekir/cron-decorators'
@CronJob
class CleanupJob {
@Schedule('0 0 * * *')
async daily() { /* nightly cleanup */ }
@Every('5m')
async heartbeat() { /* health ping */ }
}Changelog
v0.1.3LatestSeptember 16, 2026
- Published output now uses the shared Node-targeted ESM bundle pipeline with external dependencies and generated TypeScript declarations, while Bun consumers keep the native source export.
v0.1.2July 23, 2026
- Package metadata now follows the shared compatible
0.1.xdependency range used by this coordinated Tekir release.
v0.1.1June 13, 2026
@Schedulenow validates the cron pattern at decoration time, throwing a meaningful error (with the pattern) for an empty pattern or a wrong field count.@Everynow enforces sensible ranges (1-59for seconds/minutes,1-23for hours) and rejects out-of-range or unrecognized values like90s,25h, or1dinstead of silently falling back.@CronJobnow walks the prototype chain and reads methods without triggering getters, collecting each overridden method once.- Found and fixed with Fable.
v0.1.0April 1, 2026
- Initial release