timide
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

timide

Yet another resumable timer

Table of Contents

Install

$ npm install timide

Usage

const {Timer} = require('timide');

const timer = new Timer({
  // The initial state (default: `[false, 0, 0]`)
  state: [false, 1598126121368, -20000],
});

timer.on('state', (value) => {
  // Emitted when the state changes
});

// Starts the timer
timer.start();

// Stops the timer
timer.stop();

// Starts the timer including the missed time if stopped
timer.start(true);

// Updates the timer time
timer.seek(20000);

// Resets the timer
timer.reset();

API

See the declaration file.

Author

Alexandre Breteau - @0xSeldszar

License

MIT © Alexandre Breteau

/timide/

    Package Sidebar

    Install

    npm i timide

    Weekly Downloads

    1

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    5.26 kB

    Total Files

    5

    Last publish

    Collaborators

    • seldszar