Nerfing Powerful Megalomaniacs

    market-session
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.4 • Public • Published

    market-session Build Status npm version Code coverage

    Logic for financial-market sessions

    Note: all times assumed to be UTC

    Install

    npm install market-session

    Use

    import session from 'market-session'
     
    console.log(session.fromString('D'))
    //=> 1440
     
    console.log(session.toString(1440))
    //=> 1D
     
    console.log(session(new Date('2019-01-01')))
    //=> [ '5', '15', '30', '1H', '4H', '12H', '1D', '3D', '1M', '3M', '1Y' ]
     
    console.log(session(new Date('2019-04-01'), ['3M']))
    //=> ['3M']
     
    console.log(session(new Date('2019-01-01')).map(session.fromString))
    //=> [ 5, 15, 30, 60, 240, 720, 1440, 4320, 40320, 120960, 483840 ]

    Related

    Install

    npm i market-session

    DownloadsWeekly Downloads

    10

    Version

    2.0.4

    License

    ISC

    Unpacked Size

    12.1 kB

    Total Files

    6

    Last publish

    Collaborators

    • hamroctopus