{"name":"composition","description":"Compose generator and async/await middleware","version":"2.1.1","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/thenables/composition"},"dependencies":{"co":"^4.0.2","memorizer":"^1.0.0","native-or-bluebird":"^1.1.2"},"devDependencies":{"bluebird":"^2.3.11","istanbul-harmony":"0","koa-compose":"^2.3.0","matcha":"^0.6.0","mocha":"2","timeout-then":"^1.0.0"},"scripts":{"bench":"matcha bench/run.js","test":"mocha --bail","test-cov":"istanbul cover ./node_modules/.bin/_mocha -- --reporter dot","test-travis":"istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- --reporter dot"},"keywords":["co","compose","composition","middleware","decorator","decorators","async","await","yield"],"files":["index.js"],"gitHead":"a32f30b11af8447bc92a6c4a816c1a105ac58c83","bugs":{"url":"https://github.com/thenables/composition/issues"},"homepage":"https://github.com/thenables/composition","_id":"composition@2.1.1","_shasum":"c87e30b145e22c2c1603cbe600867b2d17efc17f","_from":".","_npmVersion":"2.5.1","_nodeVersion":"1.2.0","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"coderhaoxin","email":"coderhaoxin@outlook.com"}],"dist":{"shasum":"c87e30b145e22c2c1603cbe600867b2d17efc17f","tarball":"http://registry-npm.ywwl.com/composition/download/composition-2.1.1.tgz","integrity":"sha512-eamkUNJW1i2n7nlLEpsm9Yr3AtCCOlSe9AGfzFfMr146T2ZS4FsQ0gy78hrwj3a2M7V44tTL80NRIqAFNDWl7g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFbhOXHRTqxfwbOeEDN9ZydsCKNa7P9+uUL4zdjCa43nAiEA2Qe9e1UEpe6VTgeLdNCvbSY84BQv7e24iXKgglBBl3A="}],"size":2820,"noattachment":false,"key":"/composition/-/composition-2.1.1.tgz"},"readme":"\n# composition\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![Dependency Status][david-image]][david-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\nCompose generator and async/await middleware like koa.\nAllows to use both generator functions and async/await functions.\n\n```js\nvar compose = require('composition');\n\nvar stack = [];\n\n// generator functions\nstack.push(function* (next) {\n  yield next;\n});\n\n// regular functions that return anything\n// but they should be promises!\nstack.push(function (next) {\n  return Promise.resolve(true);\n});\n\n// async/await functions\nstack.push(async function (next) {\n  return await Promise.resolve(true);\n});\n\n// compose it into a function\nvar fn = compose(stack);\n\n// this function returns a promise\nfn.call(this).then(function (val) {\n  console.log(val);\n}).catch(function (err) {\n  console.error(err.stack);\n  process.exit(1);\n})\n```\n\n[gitter-image]: https://badges.gitter.im/thenables/composition.png\n[gitter-url]: https://gitter.im/thenables/composition\n[npm-image]: https://img.shields.io/npm/v/composition.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/composition\n[github-tag]: http://img.shields.io/github/tag/thenables/composition.svg?style=flat-square\n[github-url]: https://github.com/thenables/composition/tags\n[travis-image]: https://img.shields.io/travis/thenables/composition.svg?style=flat-square\n[travis-url]: https://travis-ci.org/thenables/composition\n[coveralls-image]: https://img.shields.io/coveralls/thenables/composition.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/thenables/composition\n[david-image]: http://img.shields.io/david/thenables/composition.svg?style=flat-square\n[david-url]: https://david-dm.org/thenables/composition\n[license-image]: http://img.shields.io/npm/l/composition.svg?style=flat-square\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/composition.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/composition\n","publish_time":1423962100639,"_cnpm_publish_time":1423962100639,"dist-tags":{"latest":"2.3.0"}}