remember.chrome
v1.0.2
Published
A chrome alarm manager to schedule code to run periodically or at a specified time in the future.
Downloads
7
Maintainers
Readme
remember.chrome
A chrome alarm manager to schedule code to run periodically or at a specified time in the future.
Getting started
Install remember.chrome with npm:
$ npm install remember.chrome
Initialize your alarm:
Parameters:
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
Background being remembered
import Remember from 'remember.chrome'
Remember()
.listener()
.then(alarm => {
// you will enter here, each minute that you configured
console.log(alarm) // hello
})
You can activate the debugger
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)
License
The code is available under the MIT License.