{"name":"composition","description":"Compose generator and async/await middleware","version":"2.3.0","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/thenables/composition.git"},"dependencies":{"any-promise":"^1.1.0","co":"^4.0.2"},"devDependencies":{"bluebird":"^3.1.1","istanbul":"^0.4.2","koa-compose":"^2.3.0","matcha":"^0.6.0","mocha":"^2.0.0","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":"d3cd279c4ed45ceef59cdfb03e41190efbb92b23","bugs":{"url":"https://github.com/thenables/composition/issues"},"homepage":"https://github.com/thenables/composition#readme","_id":"composition@2.3.0","_shasum":"742805374cab550c520a33662f5a732e0208d6f2","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.7.0","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"dist":{"shasum":"742805374cab550c520a33662f5a732e0208d6f2","tarball":"http://registry-npm.ywwl.com/composition/download/composition-2.3.0.tgz","integrity":"sha512-b2wTferUuej6qDfrwPnM6KNd6MHSA1q0/aatvJhUmH2/kUM5wsn4t8sc5vj0NECwsLbAM+H4WitN4d2uL0pIRg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhe3oUfYb/OtoY55eKRUrNorEt0EXpdVu0s8JONEuk1AIhAIWXYZ/VVCOZTfg64bYoT2OBNbJGfbX9K/doJCRagiTA"}],"size":2868,"noattachment":false,"key":"/composition/-/composition-2.3.0.tgz"},"maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"coderhaoxin","email":"coderhaoxin@outlook.com"}],"_npmOperationalInternal":{"host":"packages-5-east.internal.npmjs.com","tmp":"tmp/composition-2.3.0.tgz_1456695738463_0.3269298863597214"},"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":1456695741083,"_cnpm_publish_time":1456695741083,"dist-tags":{"latest":"2.3.0"}}