nice-duration
v1.0.1686658607
Published
Normalizes and formats duration to human readable string.
Downloads
18
Readme
nice-duration
Normalizes and formats duration to human readable string.
This library written in TypeScript with support for tree shakable localization. This results to 2 kb of bundle size.
Install
npm i nice-duration
Usage
import { formatDuration, formatDurationConfig } from "nice-duration"
// optional configuration
formatDurationConfig.defaultResolution = 2
const formatted = formatDuration({ minutes: 123456 })
console.log(formatted)
// >> 85 d, 17 h