1.0.1686658607 • Published 11 months ago
nice-duration v1.0.1686658607
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
1.0.1686658560
11 months ago
1.0.1686658607
11 months ago
1.0.1686571478
11 months ago
1.0.1678781189
1 year ago