cntdwn

1.0.1 • Public • Published

Cntdwn

Cntdwn is a library that calculates the difference of time between an arbitrary date and the current date and executes a callback function each second passing the new difference of time.

Installation

Just run npm install cntdwn or yarn add cntdwn

Example

  const Cntdwn = require("cntdwn");
 
  const countdown = new Cntdwn(
    new Date(2019, 1, 1),
    (days, hours, minutes, seconds) => {
      console.log(days, hours, minutes, seconds);
 
      if(days < 10) {
        countdown.stop();
      }
  });
 
  countdown.start();

Readme

Keywords

none

Package Sidebar

Install

npm i cntdwn

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • vsgoulart