Skip to content

dustyjay/Countdown-Timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Countdown-Timer

Installation

Using npm
$ npm install @dustyjay/countdown-timer
Using yarn
$ yarn add @dustyjay/countdown-timer

Usage

import { Countdown } from '@dustyjay/countdown-timer'

var interval;

var timer = Countdown('2021-12-25');
interval = setInterval(() => {
  const result = timer.startCountdown();
  console.log(result) // { days, hours, minutes, seconds, isComplete}
  if (result.isComplete) {
    clearInterval(interval);
  }
}, 1000);

Package Repo: https://github.com/dustyjay/Countdown-Timer

A light-weight package for a simple countdown timer

About

A light weight package for a simple countdown timer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published