@gabrielcsapo/countdownto
v0.0.3
Published
⏳ the countdown starts, when will it end?
Downloads
6
Readme
countdownto
⏳ the countdown starts, when will it end?
Installation
npm install @gabrielcsapo/countdownto -g
Usage
const Countdownto = require('@gabrielcsapo/countdownto');
let countdown = new Countdownto(new Date('12/21/2020'));
console.log(countdown.diff());
To get a constantly updating diff use the tick function as such:
const Countdownto = require('@gabrielcsapo/countdownto');
let countdown = new Countdownto(new Date('12/21/2020'));
countdown.tick((time) => {
console.log(time.toString());
});
CLI
Usage: countdownto [options]
Commands:
-h, --help, help Output usage information
-v, --version, version Output the version number
Options:
-t, --to [date] The date that the countdown will aim for
-f, --from [date] The date that the countdown will start from, by default it is the time when the command was initiated at
-c, --clock Will output an ascii clock that will update
Running the cli options like countdownto --to 01/01/2017 --clock
will output: