2.0.4 • Published 4 years ago

simple-timer-js v2.0.4

Weekly downloads
4
License
Apache 2.0
Repository
github
Last release
4 years ago

SimpleTimer for JavaScript

npm

A simple timer to show timer countdown on websites.

Installation

Yarn

$ yarn add simple-timer-js

NPM

$ npm install simple-timer-js

Usage

  1. Require the SimpleTimer

    var SimpleTimer = require("simple-timer-js");
  2. 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);
  3. Call startTimer() to start the timer.

    timer.startTimer();
  4. If you want to force end the timer, simply call endTimer(). Otherwise, the timer will stop on its own, after it reaches the given timerDuration.

    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.

2.0.4

4 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

1.0.0

8 years ago