Have ideas to improve npm?Join in the discussion! »

    @tehshrike/duration-iso-8601

    2.0.2 • Public • Published

    @tehshrike/duration-iso-8601

    Parse ISO 8601 Duration(PnYnMnDTnHnMnS syntax)

    https://en.wikipedia.org/wiki/ISO_8601#Durations

    Installation

    npm install @tehshrike/duration-iso-8601
    
    const parse = require('@tehshrike/duration-iso-8601')
    

    Examples

    parse('P1Y2M3DT4H5M6S') // => { year: 1, month: 2, day: 3, hour: 4, minute: 5, second: 6 }
     
    parse('P1Y30DT15M39S') // => { year: 1, day: 30, minute: 15, second: 39 }
     
    parse('ieurht834') // => null

    Install

    npm i @tehshrike/duration-iso-8601

    DownloadsWeekly Downloads

    114

    Version

    2.0.2

    License

    MIT

    Unpacked Size

    4.93 kB

    Total Files

    6

    Last publish

    Collaborators

    • avatar