@gabrielcsapo/countdownto

0.0.3 • Public • Published

countdownto

the countdown starts, when will it end?

Npm Version Build Status Coverage Status Dependency Status devDependency Status npm npm

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:

example

Readme

Keywords

none

Package Sidebar

Install

npm i @gabrielcsapo/countdownto

Weekly Downloads

0

Version

0.0.3

License

Apache-2.0

Last publish

Collaborators

  • gabrielcsapo