this package is created for project aex,
but it is general to all node.js http processing.
It is on it's early stage, any contribution is appriciated.
It provide abstract class Store and Session.
Currently only MemoryStore and CookieSession are available.
You can check the project at https://github.com/aex-ts-node/session.
import { MemoryStore, Cookie } from "@aex/session";
import * as http from "http";
const store = new MemoryStore();
const cookie = new Cookie(store);
const scope: any = {};
const server = http.createServer(function(req: any, res: any) {
cookie.parse(req, res, scope).then(() => {
scope.session.user = "alice";
res.write("Hello World!");
res.end();
});
}).listen(port);