Skip to content

Latest commit

 

History

History
39 lines (22 loc) · 617 Bytes

File metadata and controls

39 lines (22 loc) · 617 Bytes

ts-humanize v1.0.0


ts-humanize / duration

Function: duration()

duration(dur, options?): undefined | string

Defined in: time/time.ts:101

Formats a duration to a human readable string.

Negative numbers will be treated as positives

Parameters

dur

number

options?

DurationOptions

Returns

undefined | string

Example

duration(30_000_000);
// => "8 hours"

duration(3, { unit: "weeks" });
// => "3 weeks"