ms-human-format
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Duration formatter and parser

This library helps to format duration to and from human readable format.

How to use

In NodeJS

import { parseDuration, formatMs } from "duration-formatter";

parseDuration("2hours 30 minutes, 20 sec 453ms") === 9020453;
formatMs(1296575243) === "2 weeks 1 day 9 minutes 35 seconds 243 milliseconds";

In the browser - not yet supported

More libraries like this one

Package Sidebar

Install

npm i ms-human-format

Weekly Downloads

0

Version

1.1.1

License

ISC

Unpacked Size

20.9 kB

Total Files

7

Last publish

Collaborators

  • soulman.is.good