1.0.2 • Published 3 years ago
timeleft v1.0.2
About The Project
This simple package takes a number in seconds and start to count down.
Functions:
- ddhhmmss: returns an array of time left days, hours, minutes, seconds.
- ddhhmmssColon: returns a color separated string like this days : hours : minutes : seconds
- days: return string of days left 05
- dd: short name for days
- hours: return string of hours left 21
- hh: short name for hours
- minutes: return string of minutes left 51
- mm: short name for minutes
- seconds: return string of seconds left 22
- ss: short name for seconds
Getting Started
Installation
Install NPM package
npm i timeleft
Usage
ddhhmmss
import {ddhhmmss} from "timeleft";
ddhhmmss(500000);
// [05,18,53,30]
ddhhmmssColon
import {ddhhmmssColon} from "timeleft";
ddhhmmssColon(500000);
// "05 : 18 : 53 : 30"
days || dd
import {days} from "timeleft";
days(500000);
// "05"
import {dd} from "timeleft";
dd(500000);
// "05"
hours || hh
import {hours} from "timeleft";
hours(500000);
// "18"
import {hh} from "timeleft";
hh(500000);
// "18"
minutes || mm
import {minutes} from "timeleft";
minutes(500000);
// "53"
import {mm} from "timeleft";
mm(500000);
// "53"
seconds || ss
import {seconds} from "timeleft";
seconds(500000);
// "30"
import {ss} from "timeleft";
ss(500000);
// "30"