{"name":"composition","description":"Compose generator and async/await middleware","version":"2.0.0","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/thenables/composition"},"dependencies":{"memorizer":"^1.0.0","native-or-bluebird":"^1.1.2"},"devDependencies":{"bluebird":"^2.3.11","co":"^4.0.1","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":"8faedc8d6ce16d0d7ced2eef8b12fccb769cb2d5","bugs":{"url":"https://github.com/thenables/composition/issues"},"homepage":"https://github.com/thenables/composition","_id":"composition@2.0.0","_shasum":"ef5748b1fc3348947edea24ef4e9d1f5fa2869a3","_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":"ef5748b1fc3348947edea24ef4e9d1f5fa2869a3","tarball":"http://registry-npm.ywwl.com/composition/download/composition-2.0.0.tgz","integrity":"sha512-TQUfSodz/cFj094GAtd5OO+l01FogeHDLvAy1dZx8T+SjNUcG+ocT1UF6oaU5PIpBGe5pxT6OucY9wbrs1uwbw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAplPjjW6sHMhsSRrSRt9JbgccGMtvbK+zbAC+Tho2hwAiEA6Eh07InoAFAC46vZWe6xFQ/A8L1iwl0wSYByAjGLoMY="}],"size":2584,"noattachment":false,"key":"/composition/-/composition-2.0.0.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":1418868429713,"_cnpm_publish_time":1418868429713,"dist-tags":{"latest":"2.3.0"}}