A chrome alarm manager to schedule code to run periodically or at a specified time in the future.
$ npm install remember.chrome
Remember({ string name, Number periodInMinutes, Number delayInMinutes, Boolean debug })
import Remember from 'remember.chrome'
const alarm = Remember({
name: 'hello',
periodInMinutes: 1
})
.create()
setTimeout(() => {
alarm.stop()
}, 300000)
//When it is 5 minutes, it stops running an alert
import Remember from 'remember.chrome'
Remember()
.listener()
.then(alarm => {
// you will enter here, each minute that you configured
console.log(alarm) // hello
})
import Remember from 'remember.chrome'
const alarm = Remember({
name: 'hello',
periodInMinutes: 2,
delayInMinutes: 1,
debug: true
})
.create()
/*log:
[Remember] created,
name: hello,
period in minutes: 2,
delay in minutes: 1*/
setTimeout(() => {
alarm.stop() //log: [Remember] hello stopped
}, 300000)
The code is available under the MIT License.