1.1.0 • Published 6 years ago

timerlist v1.1.0

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

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