1.0.3 • Published 4 years ago

schedules v1.0.3

Weekly downloads
1
License
ISC
Repository
-
Last release
4 years ago
const Scheduler = require('schedules');
const Sch = new Scheduler("MONGO_DB_URI_GOES_HERE");
;(async() => {
await Sch.start();
await Sch.schedule(Date.now() + 5000, { hi: "test" });
console.log(await Sch.findTimestampEnded(Date.now() + 2000)) // [];
console.log(await Sch.findTimestampEnded(Date.now() + 2000)) // [{ Data: {...}}];
// The system above allows you to check for schedules that would've ended before that timestamp.
Sch.on('data', console.log); // Will log the data so when the schedule for the one above ends it'd log { hi: "test" } and how many ms after the system was supposed to end that the db picked it up
await Sch.deleteSchedules(); // Removes all schedules
})();
1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago