time-humanize

1.8.2 • Public • Published

Installation

npm i time-humanize

Usage

const { format } = require('time-humanize');

const time = format(ms, options);

Examples

const { format } = require('time-humanize');
const time = format(1000);

console.log(time); // 1 second
const time = format(86399999);

console.log(time); // 23 hours, 59 minutes, 59.99 seconds

Options

const time = format(86399999, { digits: 3 });

console.log(time); // 23 hours, 59 minutes, 59.999 seconds
const time = format(86399999, {
  lang: "en",
  round: true
});

console.log(time); // 23 hours, 59 minutes, 59 seconds
const time = format(86399999, {
  lang: "ar",
  units: ["h", "m"]
});

console.log(time); // ثواني 59, ساعات 23

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.8.2
    10
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.8.2
    10
  • 1.8.1
    0
  • 1.0.6
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i time-humanize

Weekly Downloads

10

Version

1.8.2

License

ISC

Unpacked Size

6.74 kB

Total Files

9

Last publish

Collaborators

  • darky-cpu