timerlist

1.1.0 • Public • Published


TimerList



Timerlist is a small module that allows you to have a reference of your timers.

Installation

Node.js

npm install timerlist --save

Example

const TimerList = require('timerlist');
const timer = new TimerList();
 
// Adds a timeout timer
timer.setTimeout('my timer', ()=>{
    console.log('timer boom');
}, 2000);
 
// Adds an interval timer
timer.setInterval('my timer', ()=>{
    console.log('timer next');
}, 100);
 
// Passing params to listener
timer.setTimeout('my timer', (param)=>{
    console.log('a param', param);
}, 2000, 'Hello');
 
// Destroy timeout timer
timer.clearTimeout('my timeout');
 
// Destroy interval timer
timer.clearInterval('my interval');
 
// Destroy all timers
timer.clearAll();

API Documentation

See https://github.com/fabioricali/timerlist/blob/master/api.md

Browser

Local

<script src="node_modules/timerlist/dist/timerlist.min.js"></script>

CDN unpkg

<script src="https://unpkg.com/timerlist/dist/timerlist.min.js"></script>

CDN jsDeliver

<script src="https://cdn.jsdelivr.net/npm/timerlist/dist/timerlist.min.js"></script>

Changelog

You can view the changelog here

License

TimerList is open-sourced software licensed under the MIT license

Author

Fabio Ricali

Package Sidebar

Install

npm i timerlist

Weekly Downloads

1

Version

1.1.0

License

MIT

Last publish

Collaborators

  • fabioricali