Skip to content

A chrome alarm manager to schedule code to run periodically or at a specified time in the future.

License

Notifications You must be signed in to change notification settings

victorvoid/remember.chrome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

remember.chrome

NPM version

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.

About

A chrome alarm manager to schedule code to run periodically or at a specified time in the future.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published