‚̧Numerous Packages Multiply
    Wondering what‚Äôs next for npm?Check out our public roadmap! ¬Ľ

    remember.chrome

    1.0.2¬†‚Äʬ†Public¬†‚Äʬ†Published

    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.

    Install

    npm i remember.chrome

    DownloadsWeekly Downloads

    1

    Version

    1.0.2

    License

    MIT

    Last publish

    Collaborators

    • avatar