@spoot/schedule
v1.0.0
Published
Recurring schedule definitions (daily, weekly, monthly) with Day-based date matching
Readme
@spoot/schedule
Recurring schedule definitions with @spoot/day date matching. Define daily, weekly, or monthly schedules and check whether a given Day falls within them.
Install
npm install @spoot/schedule @spoot/dayUsage
import { Schedule } from "@spoot/schedule";
import { Day } from "@spoot/day";
const everyMonday = Schedule.weekly({ dayOfWeek: 1 });
const firstOfMonth = Schedule.monthly({ dayOfMonth: 1 });
const today = Day.today();
console.log(everyMonday.includes(today)); // true or false
console.log(firstOfMonth.includes(today)); // true or falseDevelopment
pnpm typecheck # type-check
pnpm test # run Jest tests
pnpm build:lib # compile to dist/