koajs/session

Feature: Add ability to parse string of maxAge

hoangvvo opened this issue · 0 comments

It is difficult to set maxAge to milisecond for large value such as month or year.

It would be great to be able to do something like:

const CONFIG = {
  maxAge: '1 month 2 weeks'
}

instead of

const CONFIG = {
  maxAge: 3839343830 // yucks
}

If this is a good one to have, I can make a PR for it. (as implemented in my next-session, see the bottom of the table)