UNPKG

express-post-task-scheduler

Version:

A lightweight npm package to create and manage scheduled tasks using Express middleware. Configure tasks via POST requests and execute them at specified times seamlessly.

24 lines (23 loc) 731 B
import { Job } from "node-schedule"; import { IJob } from "./@types/job"; /** * Store and control the generated schedule jobs from node-schedule */ export declare class ScheduleJobs { private static instance; /** * The array to store jobs generated by node-schedule's scheduleJob method */ jobList: IJob[]; /** * Create or get exist instance of the class */ static init(): ScheduleJobs; /** * Push a new job inside the list from the params and returned instance of node-schedule's scheduler.scheduleJob * @param taskId * @param jobInstance * @param executor */ static appendJob(taskId: number, jobInstance: Job, executor: (...args: any[]) => any): void; }