Set an (recurring) alarm at a daytime.
$ npm i daytime-alarm
import daytimeAlarm from "daytime-alarm"
// Alarm hits next time the clock shows 15:35:30
let alarm = daytimeAlarm("15:35:30").onAlarm((time) => {
console.log("Alarm" + time) // "Alarm 15:35:30"
})
alarm.cancel()
post("/activateAlarm", () => {
alarm.start()
})
alarm.repeat("daily")
post("/noLongerRepeat", () => {
alarm.once()
})
All feedback is appreciated. Create a pull request or write an issue.