New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

countdown-x

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

countdown-x

The helper function countdown time

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
7
600%
Maintainers
1
Weekly downloads
 
Created
Source

How to install

You can using a in 2 way

    npm install countdown-x
    npm i countdown-x

How to use

See the example below to use it

    var countdownX = require("countdown-x");

    // Using: countdown
    setInterval(() => {
        // it's was called every seconds

        console.log(countdownX.fromNow().countdown("2033/12/10 16:23:00")) // {days: 8, hours: "00", minutes: "05", months: 2, seconds: 44, years: 13}
    }, 1000)


    // Using: countdownEvery
    countdownX
    .fromNow()
    .countdownEvery("2033/12/10 16:23:00", { ms: 1000 }, (values) => {
        // Do something with values
        // it's was called every seconds
        
        console.log(values); // {days: 8, hours: "00", minutes: "05", months: 2, seconds: 44, years: 13}
    });

Documentation

  • eventDate format (ISO 8601 - UTC): yyyy/mm/dd HH:MM:SS
APIDescriptionReturn
fromNow()Setup countdown destinationvoid
countdown(eventDate)The countdown function{days, hours, minutes, months, seconds, years}
countdownEvery(eventDate, options{ms: number}, callback)The countdown function automatically according to predetermined timevoid

Versions history

The versionDescriptionIssues
v1.0.0Project initializationNo issue
v1.0.1Clean codeNo issue
v1.0.2Clean codeNo issue
v1.0.3Clean codeNo issue
v1.0.4FixThe countdown time is wrong
v1.0.4-1Refactoring the source codeStructure
v1.0.4-2Change example codeNo issue
v1.0.5Add type and supported suggest codeNo issue
v1.1.0add new function support auto setIntervalNo issue

Keywords

countdown

FAQs

Package last updated on 12 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts