ea-session-storage
1.0.1 • Public • Published ea-session-storage
npm install --save ea-session-storage
Usage with express
var http = require('http');
var express = require('express');
var storage = require('ea-session-storage');
var app=express();
var PORT=5555;
app.use('/storage', storage({sessionSecret:'hello kitty',expireDays:90}));
http.createServer(app).listen(PORT);
In the browser
<script src="http://localhost:5555/storage/client.js"></script>
<script>
(async()=>{
storage.baseURI="http://localhost:5555/storage/";
await storage.setItem('person',{jenny:13});
console.log(await storage.getItem('person'));
})()
</script>
Package Sidebar
Install
Weekly Downloads