connect-session-as-promised
Because connect sessions depend too heavily on `this`
Last updated 7 years ago by phated .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install connect-session-as-promised 
SYNC missed versions from official npm registry.

Build Status

connect-session-as-promised

Because connect sessions depend too heavily on this

Usage

Exposes regenerate, destroy, reload & save which are analogous to Connect Session methods of the same names

The only difference is that they return a promise that is resolved or rejected based on the result of the session call.

var session = require('connect-session-as-promised');

app.get('/', function(req, res){
  session.regenerate(req); // analogous to req.session.regenerate(function(err){});
  session.destroy(req);    // analogous to req.session.destroy(function(err){});
  session.reload(req);     // analogous to req.session.reload(function(err){});
  session.save(req);       // analogous to req.session.save(function(err){});
});

Current Tags

  • 0.1.0                                ...           latest (7 years ago)

1 Versions

  • 0.1.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (1)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |