Numerous Pulls Merged

    koa-continuation-local-storage

    1.0.2 • Public • Published

    koa-continuation-local-storage Build Status

    continuation-local-storage middleware for koa.

    install

    Install the package with npm:

    $ npm install koa-continuation-local-storage

    usage

    import cls from 'koa-continuation-local-storage';
    import koa from 'koa';
    import { createNamespace } from 'continuation-local-storage';
     
    const ns = createNamespace('ns');
    const app = koa();
     
    app
      .use(cls({
        ns: ns
      }))
      .use(function* (next) {
        ns.set('foo', 'bar');
        yield* next;
      })
      .use(function* () {
        this.body = ns.get('foo');
      });

    api

    cls(opts)

    Create middleware that wraps downstream middlewares to opts.ns namespace.

    license

    MIT

    Install

    npm i koa-continuation-local-storage

    DownloadsWeekly Downloads

    2

    Version

    1.0.2

    License

    MIT

    Last publish

    Collaborators

    • lennon