simple-timer-js
v2.0.4
Published
A simple timer to show timer countdown on websites.
Downloads
5
Readme
SimpleTimer for JavaScript
A simple timer to show timer countdown on websites.
Installation
Yarn
$ yarn add simple-timer-jsNPM
$ npm install simple-timer-jsUsage
Require the
SimpleTimervar SimpleTimer = require("simple-timer-js");Create a new SimpleTimer instance with the expected
duration,timerContainer,originalText.var timerDurationInSeconds = 60; var uniqueTimerContainerClassName = "timer-container"; var originalTextInContainer = ""; var timer = new SimpleTimer(timerDurationInSeconds, uniqueTimerContainerClassName, originalTextInContainer);Call
startTimer()to start the timer.timer.startTimer();If you want to force end the timer, simply call
endTimer(). Otherwise, the timer will stop on its own, after it reaches the giventimerDuration.timer.endTimer();
Contributing
We'd love to accept your patches and contributions to this project! Checkout contributing and code of conduct to learn more.
License
Refer to the license file.
