@maxdome/duration

3.0.1 • Public • Published

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.

/@maxdome/duration/

    Package Sidebar

    Install

    npm i @maxdome/duration

    Weekly Downloads

    2

    Version

    3.0.1

    License

    MIT

    Unpacked Size

    4.29 kB

    Total Files

    5

    Last publish

    Collaborators

    • dragonnodejs
    • sharaal
    • fabsrc
    • markusz
    • mxdbv
    • csaba.lorincz
    • goexrock
    • dimified