1.0.0 • Published 9 years ago

koa-add-to-context v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

koa-add-to-context

npm version build status coverage status

Koa middleware to add all enumerable keys to the context of each request

Installation

$ npm i koa-add-to-context

Usage

var addToContext = require('koa-add-to-context')
var koa = require('koa')

var app = koa()
app.use(addToContext({ foo: 'foo' }))
app.use(function * () {
  this.body = this.foo
})

API

addToContext(obj: Object): GeneratorFunction

Test

npm test

License

MIT