{"name":"composition","description":"Compose generator and async/await middleware","version":"2.0.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","mocha":"2","timeout-then":"^1.0.0"},"scripts":{"test":"mocha --harmony-generators --reporter spec","test-cov":"node --harmony-generators node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --reporter dot","test-travis":"node --harmony-generators node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- --reporter dot"},"keywords":["co","compose","composition","middleware","decorator","decorators","async","await","yield"],"files":["index.js"],"gitHead":"dfa27c3f580f028f914f8f338db5b18d144b146f","bugs":{"url":"https://github.com/thenables/composition/issues"},"homepage":"https://github.com/thenables/composition","_id":"composition@2.0.1","_shasum":"4b9c9e1779a77c85970fc19c4cd4b5649c0f856b","_from":".","_npmVersion":"2.1.12","_nodeVersion":"0.11.14","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"coderhaoxin","email":"coderhaoxin@outlook.com"}],"dist":{"shasum":"4b9c9e1779a77c85970fc19c4cd4b5649c0f856b","tarball":"http://registry-npm.ywwl.com/composition/download/composition-2.0.1.tgz","integrity":"sha512-0I81D16LMDKigh6W5PyEG/uZUrBijRLMeExLEv3Ozyv72agMg0eZ66jnT/kPTLH7Ih/l/VrCgdLCfAUvRBOJvw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBd2Z9KCpdXzpDcNhoN2eR0s4b2qLO9jZxxyEqjtj8JrAiEA2tpjbXGi/iudzt2/7cAmCAB8Ui4/IfnfDkZ68G63FkE="}],"size":2577,"noattachment":false,"key":"/composition/-/composition-2.0.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":1419123130179,"_cnpm_publish_time":1419123130179,"dist-tags":{"latest":"2.3.0"}}