@pxtrn/timer

2.0.0 • Public • Published

@pxtrn/timer

Emits tick based on a cron expression. See cron-parser for supported formats.

Installation

npm install --save @pxtrn/timer

Usage

const Timer = require('@pxtrn/timer');

const timer = new Timer('00 * * * * *', {delay: 200});
timer.on('tick', () => {
  console.log('Tick', new Date())
});

Class: Timer

  • expression {String} Cron expression. See [cron-parser](https://www.npmjs.com/package/cron-parser#supported-format)
  • options {Object} Optional
    • delay: {Integer} Delay in milliseconds. Default 0

Readme

Keywords

Package Sidebar

Install

npm i @pxtrn/timer

Weekly Downloads

2

Version

2.0.0

License

MIT

Unpacked Size

2.94 kB

Total Files

4

Last publish

Collaborators

  • pixtron