0.0.1 • Published 4 years ago

alarms v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

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.