micro-session is a session manager for Zeit.co's micro framework. Heavily based on express-session.
$ npm install micro-session
# or
$ yarn add micro-sessionconstsession,{ MemoryStore }=require('micro-session')constgetSession=session({store: newMemoryStore(),secret: 'keyboard cat'})module.exports=async(req,res)=>{letsession=awaitgetSession(req,res)if(!session.test){session.test=1}else{session.test+=1}return{t: session.test}}Note that sessions are automatically stored if needed after res.end is called. All session stores that support express-session should also support micro-session.
Options are the same as express-session where applicable. session API is also the same as express-session.