# 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.
- End date (string and date object only)
- Days element CSS class selector to display days (string only).
- Hours element CSS class selector to display hours (string only).
- Minutes element CSS class selector to display minutes (string only).
- 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