alarms

0.0.1 • Public • Published

Alarms

A simple alarm that will execute specified function at specified time.

Usage

const alarms = require('alarms')

alarms({ hour: 13, minute: 45, second: 17, daily: true, verbose: false }, () => console.log('Alarm!'))

Parameters

The first argument is the alarm setting, which should be a object contains:

  • hour: number, required.
  • minute: number, required.
  • second: number, default: 0.
  • daily: boolean, default: false.
    • If daily is true, the alarm will repeat everyday.
  • verbose: boolean, default: false.
    • If verbose is true, it will output some log when the function is executed.

TODO lists

  • Alarms can be canceled.
  • Custom repeat period.
  • Parameter can be a Date object.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i alarms

      Weekly Downloads

      1

      Version

      0.0.1

      License

      ISC

      Unpacked Size

      2.77 kB

      Total Files

      3

      Last publish

      Collaborators

      • edisonhello