{"action":"opened","issue":{"url":"https://api.github.com/repos/tunnckoCore/koa-better-body/issues/31","repository_url":"https://api.github.com/repos/tunnckoCore/koa-better-body","labels_url":"https://api.github.com/repos/tunnckoCore/koa-better-body/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/tunnckoCore/koa-better-body/issues/31/comments","events_url":"https://api.github.com/repos/tunnckoCore/koa-better-body/issues/31/events","html_url":"https://github.com/tunnckoCore/koa-better-body/issues/31","id":146426936,"number":31,"title":"Transform to class","user":{"login":"tunnckoCore","id":5038030,"avatar_url":"https://avatars.githubusercontent.com/u/5038030?v=3","gravatar_id":"","url":"https://api.github.com/users/tunnckoCore","html_url":"https://github.com/tunnckoCore","followers_url":"https://api.github.com/users/tunnckoCore/followers","following_url":"https://api.github.com/users/tunnckoCore/following{/other_user}","gists_url":"https://api.github.com/users/tunnckoCore/gists{/gist_id}","starred_url":"https://api.github.com/users/tunnckoCore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tunnckoCore/subscriptions","organizations_url":"https://api.github.com/users/tunnckoCore/orgs","repos_url":"https://api.github.com/users/tunnckoCore/repos","events_url":"https://api.github.com/users/tunnckoCore/events{/privacy}","received_events_url":"https://api.github.com/users/tunnckoCore/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tunnckoCore/koa-better-body/labels/todo","name":"todo","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-06T20:37:31Z","updated_at":"2016-04-06T20:37:31Z","closed_at":null,"body":"for `v2.1`. Something like\r\n\r\n```js\r\nvar koa = require('koa')\r\nvar body = require('koa-better-body')\r\n\r\nvar app = koa()\r\napp.use(body.middleware(options))\r\n```\r\n\r\nOr you will be able to use it like `koa-body-parsers`\r\n\r\n```\r\nvar koa = require('koa')\r\nvar Body = require('koa-better-body').KoaBetterBody\r\nvar app = koa()\r\nnew Body(app)\r\n\r\napp.use(function * () {\r\n  this.body = yield this.request.multipart(this, options)\r\n  // this.body = yield this.request.json(options)\r\n  // etc\r\n})\r\n```\r\n\r\nsomething like that.. it's not clear enough in my mind."}}