cooldown-duration

1.1.5 • Public • Published

Usage:

const cooldownDuration = require('cooldown-duration');

const duration = 1234567890;
const timeFormat = 'long';
const displayFormat = 'full';

console.log(cooldownDuration(duration, timeFormat, displayFormat));

Output:

2 weeks, 6 hours, 56 minutes, 8 seconds

Options:

  • Duration <Integer> : the cooldown duration in milliseconds
  • TimeFormat <String> : 'long' / 'short' (years, weeks, etc. / y, w, etc.)
  • DisplayFormat <String> : 'full' / 'partial' (2 hours, 24 minutes, 9 seconds / 2 hours)

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i cooldown-duration

      Weekly Downloads

      3

      Version

      1.1.5

      License

      none

      Unpacked Size

      4.71 kB

      Total Files

      3

      Last publish

      Collaborators

      • xbloedarend