Minimal Countdown Timer In Vanilla JavaScript – Timers.js

Category: Date & Time , Javascript | November 8, 2018
Author: renjithspace
Views Total: 1,693 views
Official Page: Go to website
Last Update: November 8, 2018
License: MIT


Minimal Countdown Timer In Vanilla JavaScript – Timers.js


Timers.js is a lightweight, dependency-free JavaScript library for creating a minimal, clean, controllable countdown timer on the page.

The timer enables you to countdown from a specific time and display the remaining time in hours, minutes and seconds

How to use it:

Install & Download.

$ npm install timers.js --save

Import the timers.js into the html.

<script src="/dist/js/timers.js"></script>

Create a <time> element for the countdown timer.


Initialize the timers.js and specify the time you want to countdown from.

let myTimer = new Timer({
    el: 'time',
    time: {
      second: 1,
      minute: 1,
      hour: 1

Control the countdown timers with the following methods.

// pause the countdown timer

// stop the countdown timer

// resume the countdown timer

Get the current time (hour/minute/second).


Set the time.

myTimer.set('second|minute|hour', value)

You Might Be Interested In:

Leave a Reply