JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q48757F
  • License ISC

Set an (recurring) alarm at a daytime.

Package Exports

  • daytime-alarm

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (daytime-alarm) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Daytime alarm

Set an (recurring) alarm at a daytime.

Installation

 $ npm i daytime-alarm

Usage

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"
})

On / Off

alarm.cancel()

post("/activateAlarm", () => {
  alarm.start()
})

Repeat

alarm.repeat("daily")

post("/noLongerRepeat", () => {
  alarm.once()
})

Contribute

All feedback is appreciated. Create a pull request or write an issue.