npm.io
1.1.1 • Published 2 years ago

ms-human-format

Licence
ISC
Version
1.1.1
Deps
0
Size
20 kB
Vulns
0
Weekly
3

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

Keywords