3.0.1 • Published 5 years ago

@maxdome/duration v3.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Usage

const duration = require('@maxdome/duration');

const milliseconds = duration('1h 20m').milliseconds();

Input formats

  • ns, nanosecond
  • microsecond, μs
  • ms, millisecond
  • s, sec, second
  • m, min, minute
  • h, hr, hour
  • d, day
  • w, wk, week
  • month
  • y, yr, year

All formats also support the pluralizationed variants (e.g. seconds).

Output format methods

  • .nanoseconds()
  • .microseconds()
  • .milliseconds()
  • .seconds()
  • .minutes()
  • .hours()
  • .days()
  • .weeks()
  • .months()
  • .years()
  • .toISOString()

The output format methods are restricted to the pluralizationed variants to make the duration objects compatible to moment.duration.