async-session
v0.1.1
Published
Creates global session object, storing across asynchronous calls
Downloads
3
Readme
async-session
Creates global session object, storing across asynchronous calls
Instalation
npm install async-session
Usage
require('async-session');
var counter = 0;
setInterval(function () {
counter++;
global.session = {
myProperty: 'counter = ' + counter
};
setTimeout(function () {
console.log(global.session.myProperty);
}, 5000);
}, 1000);
/*
will print:
counter = 1
counter = 2
counter = 3
...
*/