@klimenty/count-down

1.2.0 • Public • Published

# CountDownNPM.

NPM package that allows you to display a count down timer on a web page.

Import the package to your project


import { countDownModule } from "/node_modules/@klimenty/count-down/index.js";

Create a timer instance and pass it all the necesseary props for your count down.

  1. End date (string and date object only)
  2. Days element CSS class selector to display days (string only).
  3. Hours element CSS class selector to display hours (string only).
  4. Minutes element CSS class selector to display minutes (string only).
  5. Seconds element CSS class selector to display seconds (string only).

const timer = countDownModule({
  cDate: new Date("June 22, 2022 00:00:00"),
  daysElement: ".time-day",
  hoursElement: ".time-hours",
  minutesElement: ".time-minutes",
  secondsElement: ".time-seconds",
});

Stop the timer (setTimeout recommended)


setTimeout(timer.stop(), ms);

Klimenty 2022

Package Sidebar

Install

npm i @klimenty/count-down

Weekly Downloads

0

Version

1.2.0

License

MIT

Unpacked Size

4 kB

Total Files

3

Last publish

Collaborators

  • klimenty