iauction

0.0.9 • Public • Published

iAuction

npm GitHub code size in bytes

Helps you watch your countdown

Installation

Using NPM:

npm install iauction

Using Yarn:

yarn add iauction

Usage

// basic
const iauction = require("iauction")
...
iauction({
  countdownInMin: 1,
  startDate: "2022/04/26 17:30:00",
  endDate: "2022/04/26 17:30:00",
  callback: (time) => console.log(time),
});

// UNIX date
iauction({
  countdownInMin: 2,
  startDate: 1650974160000,
  endDate: 1650974400000,
  callback: (time) => console.log(time),
});

// e.g React JS
import iauction from "iauction"

...
useEffect(() => {
  iauction({
    countdownInMin: 1,
    startDate: "2022/04/26 17:33:00",
    endDate: "2022/04/26 17:33:00",
    callback: (time) => console.log(time),
    // time ~ { start: [bool], time: [string], reps: [integer] }
  });
}, [])
Parameters Value type Description Information
countdownInMin integer set your timer interface, it will affect to your callback default 2
startDate string when to start, basically the timer always do their job, but start and reps will tell you is the status was start (boolean) and how many repetition (reps) left until the status start change to true use your local time and set with the format (YYYY-MM-DD HH:mm:ss) this will be convert to universal time in the system
endDate string when the countdown should stop and don't call your callback again use your local time and set with the format (YYYY-MM-DD HH:mm:ss) this will be convert to universal time in the system
callback function this function will return the { start: [boolean], time: [string], reps: [integer] } start: indicates is now time to start?, time: indicates the countdown, reps: how many repetition has been through from startDate

Why iAuction?

iauction helps you to watch your countdown and set the start and end datetime easier by using your local time.

iauction methods are great for:

  • Handling auction such dutch auction for NFT
  • Handling common auction

Support this package by adding features 🏏

Steps:

  • Create feature on your local machine and make sure it's work
  • Don't forget to put documentation and also test case to help me use your feature
  • Make a request from your branch ([username]-[feature_name]) to branch features

✏️ notes: please create your branch by following this format: ([username]-[feature_name])

Package Sidebar

Install

npm i iauction

Weekly Downloads

1

Version

0.0.9

License

none

Unpacked Size

6.84 kB

Total Files

3

Last publish

Collaborators

  • irwansyafani