npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

periodic

0.0.2

@juliangruber

npmHomeRepoSnykSocket
Downloads:6
$ npm install periodic
DailyWeeklyMonthlyYearly

periodic

Reliable intervals.

Build Status

browser support

Usage

var periodic = require('periodic');

var ticks = 0;

periodic(1000)
  .on('tick', function () {
    console.log('tick');
    if (++ticks == 10) this.end();
  })

API

periodic(interval)

Return a new periodic that emits tick events every interval milliseconds.

periodic tries to stay in time even when the event loop is busy.

periodic#end()

Stop emitting.

Installation

With npm do

$ npm install periodic

Alternatives

every by chrisdickinson has a nicer name but the overall interface and implementation are too complex for my needs.

License

(MIT)