1.0.2 • Published 8 months ago

@igorkowalczyk/countdown v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Countdown.js

📥 Installation

npm install @igorkowalczyk/countdown
yarn add @igorkowalczyk/countdown
pnpm add @igorkowalczyk/countdown

!NOTE This package can be used in both CommonJS and ESM environments.

📦 Usage

ESM

import Timer from "@igorkowalczyk/countdown";
const timer = new Timer();

timer.on("tick", (ms) => console.log("tick", ms));
timer.on("done", () => console.log("done!"));
timer.on("statusChanged", (status) => console.log("Status: ", status));

timer.start(20000); // Timer for 20s

CommonJS

const Timer = require("@igorkowalczyk/countdown");
const timer = new Timer();

timer.on("tick", (ms) => console.log("tick", ms));
timer.on("done", () => console.log("done!"));
timer.on("statusChanged", (status) => console.log("Status: ", status));

timer.start(20000); // Timer for 20s

⁉️ Issues

If you have any issues with this package please create new issue here

📥 Pull Requests

When submitting a pull request:

  • Clone the repo.
  • Create a branch off of master and give it a meaningful name (e.g. my-awesome-new-feature).
  • Open a pull request on GitHub and describe the feature or fix.

📋 License

This project is licensed under the MIT. See the LICENSE file for details