maxage

    1.1.1 • Public • Published

    session maxage generator

     

    INSTALL
    npm i maxage
    

     

    GET STARTED
    const maxage = require("maxage");
    
    /*
      usage: maxage(x?: number, flag?: string)
    
      flags:
        years|year
        months|month
        weeks|week
        days|day
        hours|hour
        minutes|minute
        seconds|second
        milliseconds|millisecond|ms
    
      examples:
        maxage(1, "year")
        maxage("1", "years")
    
        maxage("1 year")
        maxage("1 years")
    */
    
    console.log(maxage(1, "year"));
    console.log(maxage("1", "years"));
    // => 31536000000
    
    console.log(maxage("1 year"));
    console.log(maxage("1 years"));
    // => 31536000000
    
    console.log(maxage(1));
    console.log(maxage("1"));
    // => 1
    
    console.log(maxage());
    console.log(maxage("one"));
    console.log(maxage("one", "year"));
    console.log(maxage("one", "years"));
    console.log(maxage("one years"));
    // => NaN

    Install

    npm i maxage

    DownloadsWeekly Downloads

    0

    Version

    1.1.1

    License

    ISC

    Unpacked Size

    2.64 kB

    Total Files

    3

    Last publish

    Collaborators

    • vaidapt