A general purpose async session for node.js

--

this package is created for project [aex](https://github.com/calidion/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](https://github.com/aex-ts-node/session).

Usage:

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);

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

李白字一日
李白字一日

No responses yet