{"_id":"babel-plugin-async-to-promises","_rev":"8-5fb319f11b3164c1a72900bc847140a2","name":"babel-plugin-async-to-promises","description":"Transpile ES7 async/await to vanilla ES6 Promise chains","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.3":{"name":"babel-plugin-async-to-promises","version":"1.0.3","description":"Transpile ES7 async/await to vanilla ES6 Promise chains","repository":{"type":"git","url":"git+https://github.com/marten-de-vries/kneden.git"},"author":{"name":"Marten de Vries"},"main":"lib/index.js","devDependencies":{"babel-cli":"^6.4.5","babel-core":"^6.3.17","babel-eslint":"^6.0.0-beta.6","babel-istanbul":"^0.7.0","babel-preset-es2015":"^6.3.13","babel-register":"^6.4.3","eslint":"^2.0.0","mocha":"^2.2.5"},"scripts":{"clean":"rm -rf lib","build":"babel src -d lib","test":"npm run test:lint && npm run test:cov","test:cov":"babel-node node_modules/.bin/babel-istanbul cover _mocha && babel-istanbul check-coverage --statements 100 --functions 100 --branches 100 --lines 100","test:js":"mocha --compilers js:babel-register","test:lint":"eslint src/*.js test/index.js && eslint test/fixtures/*/*.js","test:watch":"npm run test:js -- --watch","prepublish":"npm run clean && npm run build"},"keywords":["es","7","6","babel","promise","async","await","promises","function","functions","plugin","babel-plugin"],"dependencies":{"babel-helper-hoist-variables":"^6.5.0","babel-template":"^6.3.13","babel-types":"^6.5.2","js-extend":"^1.0.1"},"license":"ISC","gitHead":"31da9d8cfbbc56d968532f93ed27f8eef662c2fa","bugs":{"url":"https://github.com/marten-de-vries/kneden/issues"},"homepage":"https://github.com/marten-de-vries/kneden#readme","_id":"babel-plugin-async-to-promises@1.0.3","_shasum":"80c86c2d08737e36b9c5b2666128a363a4c46e97","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"commandoline","email":"marten@marten-de-vries.nl"},"dist":{"shasum":"80c86c2d08737e36b9c5b2666128a363a4c46e97","tarball":"https://registry.npmjs.org/babel-plugin-async-to-promises/-/babel-plugin-async-to-promises-1.0.3.tgz","integrity":"sha512-R6MDbnvb4KHY7RFIzg6i4G9quEnBTysTKJtuvitJvYuAXoeJSwVfQwIEIrSX4mXNS0M/7tExo6NhDbeCcW0hNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICR3mvjSPPFSf/RgfXw/AzAyrf3KQ2qMkkTHuVnNr2mKAiA7E5zvxt/DTPyupxlofvAg6EjuxdfyHx/Z3qtigzYsug=="}]},"maintainers":[{"name":"commandoline","email":"marten@marten-de-vries.nl"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/babel-plugin-async-to-promises-1.0.3.tgz_1458918112363_0.9329688660800457"}},"1.0.4":{"name":"babel-plugin-async-to-promises","version":"1.0.4","description":"Transpile ES7 async/await to vanilla ES6 Promise chains","repository":{"type":"git","url":"git+https://github.com/marten-de-vries/kneden.git"},"author":{"name":"Marten de Vries"},"main":"lib/index.js","devDependencies":{"babel-cli":"^6.4.5","babel-core":"^6.3.17","babel-eslint":"^6.0.0-beta.6","babel-istanbul":"^0.7.0","babel-preset-es2015":"^6.3.13","babel-register":"^6.4.3","eslint":"^2.0.0","mocha":"^2.2.5"},"scripts":{"clean":"rm -rf lib","build":"babel src -d lib","test":"npm run test:lint && npm run test:cov","test:cov":"babel-node node_modules/.bin/babel-istanbul cover _mocha && babel-istanbul check-coverage --statements 100 --functions 100 --branches 100 --lines 100","test:js":"mocha --compilers js:babel-register","test:lint":"eslint src/*.js test/index.js && eslint test/fixtures/*/*.js","test:watch":"npm run test:js -- --watch","prepublish":"npm run clean && npm run build"},"keywords":["es","7","6","babel","promise","async","await","promises","function","functions","plugin","babel-plugin"],"dependencies":{"babel-helper-hoist-variables":"^6.5.0","babel-template":"^6.3.13","babel-types":"^6.5.2","js-extend":"^1.0.1"},"license":"ISC","gitHead":"03a33a44d00bf21e07a8dd35f471803da0ed3508","bugs":{"url":"https://github.com/marten-de-vries/kneden/issues"},"homepage":"https://github.com/marten-de-vries/kneden#readme","_id":"babel-plugin-async-to-promises@1.0.4","_shasum":"e3bf47d07126de33b38013af7b97e56f0bf80820","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"commandoline","email":"marten@marten-de-vries.nl"},"dist":{"shasum":"e3bf47d07126de33b38013af7b97e56f0bf80820","tarball":"https://registry.npmjs.org/babel-plugin-async-to-promises/-/babel-plugin-async-to-promises-1.0.4.tgz","integrity":"sha512-EdTa6xdZoxo/Omx8MJTEansLJU7Gcp3dWW5xdR/evatHzcIc/KdxLzA6vtDDqlkdMER5J9gdM5Do3bNVahirqg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHdPwMnYNRfYHqVJJNKfO4aU7q/haRsq3UJFQG+ZbhdOAiEA7PA0KtAkU1OHCj7q9OGktmFptLcgwCdF02qTnkx/S5A="}]},"maintainers":[{"name":"commandoline","email":"marten@marten-de-vries.nl"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/babel-plugin-async-to-promises-1.0.4.tgz_1458918827688_0.6478224575985223"}},"1.0.5":{"name":"babel-plugin-async-to-promises","version":"1.0.5","description":"Transpile ES7 async/await to vanilla ES6 Promise chains","repository":{"type":"git","url":"git+https://github.com/marten-de-vries/kneden.git"},"author":{"name":"Marten de Vries"},"main":"lib/index.js","devDependencies":{"babel-cli":"^6.4.5","babel-core":"^6.3.17","babel-eslint":"^6.0.0-beta.6","babel-istanbul":"^0.8.0","babel-preset-es2015":"^6.3.13","babel-register":"^6.4.3","eslint":"^2.0.0","mocha":"^2.2.5"},"scripts":{"clean":"rm -rf lib","build":"babel src -d lib","test":"npm run test:lint && npm run test:cov","test:cov":"babel-node node_modules/.bin/babel-istanbul cover _mocha && babel-istanbul check-coverage --statements 100 --functions 100 --branches 100 --lines 100","test:js":"mocha --compilers js:babel-register","test:lint":"eslint src/*.js test/index.js && eslint test/fixtures/*/*.js","test:watch":"npm run test:js -- --watch","prepublish":"npm run clean && npm run build"},"keywords":["es","7","6","babel","promise","async","await","promises","function","functions","plugin","babel-plugin"],"dependencies":{"babel-helper-hoist-variables":"^6.5.0","babel-template":"^6.3.13","babel-types":"^6.5.2","js-extend":"^1.0.1"},"license":"ISC","gitHead":"a9dbe08a845c8a43955f33dad81ef4fd646887fd","bugs":{"url":"https://github.com/marten-de-vries/kneden/issues"},"homepage":"https://github.com/marten-de-vries/kneden#readme","_id":"babel-plugin-async-to-promises@1.0.5","_shasum":"cfdc47d1468ce32bee6d38862bfccd2b59daf25b","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"commandoline","email":"marten@marten-de-vries.nl"},"dist":{"shasum":"cfdc47d1468ce32bee6d38862bfccd2b59daf25b","tarball":"https://registry.npmjs.org/babel-plugin-async-to-promises/-/babel-plugin-async-to-promises-1.0.5.tgz","integrity":"sha512-N8xqEuHCcE+B13WIooPuAuqM0GfZ0cwrWkMj5pPgEiROnCEFT0NPGsjueJJY39BGkMUxIP9/8/oYbQuLw5p1WA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDojiI7rp4Ulp7BBIEHXqZx9h/dXXhPOz1MbW60nCkxqAIgVe6+kbL0HpChEIAnlKe7KR7TKoBzlV1JvHMhXMpWTCo="}]},"maintainers":[{"name":"commandoline","email":"marten@marten-de-vries.nl"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/babel-plugin-async-to-promises-1.0.5.tgz_1461507176426_0.44069095980376005"}}},"readme":"Kneden (babel-plugin-async-to-promises)\n=======================================\n\n[![Build Status](https://travis-ci.org/marten-de-vries/kneden.svg?branch=master)](https://travis-ci.org/marten-de-vries/kneden)\n[![Dependency Status](https://david-dm.org/marten-de-vries/kneden.svg)](https://david-dm.org/marten-de-vries/kneden)\n[![devDependency Status](https://david-dm.org/marten-de-vries/kneden/dev-status.svg)](https://david-dm.org/marten-de-vries/kneden#info=devDependencies)\n\n> Transpile ES7 async/await to vanilla ES6 Promise chains\n\n**WARNING: Kneden\n[is usable](https://github.com/pouchdb/pouchdb-plugin-helper/pull/9), but it's\nalso [not complete yet](https://github.com/marten-de-vries/kneden/issues/13).**\n\nDo you want an ES7 async/await transpiling [Babel](https://babeljs.io/) plugin,\nthat:\n\n- produces readable code - even when generator functions are not available?\n- doesn't come with a runtime your users have to download?\n\nThen look no further! **Kneden (babel-plugin-async-to-promises)** can help you.\n\n## Example\n\n**In**\n\n```js\nasync function test() {\n  await db.destroy();\n}\n```\n\n**Out**\n\n```js\nfunction test() {\n  return Promise.resolve().then(function () {\n    return db.destroy();\n  }).then(function () {});\n}\n```\n\n(The last .then() might seem superfluous at first, but the first function\ndoesn't actually resolve to anything so it's necessary to make a valid\ntranslation.)\n\n**Kneden** tries to translate ES7 async/await to promises in a manner similar to\nhow a human would do so. Loops are converted to recursive functions, and your\ncode is modified in such a way that a return won't just drop you in the next\npart of the promise chain, but actually does what you expect it to do.\n\nFor more examples, see the\n[test/fixtures directory](https://github.com/marten-de-vries/kneden/tree/master/test/fixtures)\nfor both the input and output **Kneden** takes/produces.\n\n## Installation\n\n```sh\n$ npm install babel-plugin-async-to-promises\n```\n\n## Usage\n\nNote: Kneden only supports transpiling ES5 with the addition of async/await. If\nyou're using other ES6 features (like arrow functions, let/const, classes,\netc.), make sure you transpile them down to valid ES5 code first using the\n[babel es2015 preset](https://www.npmjs.com/package/babel-preset-es2015). See\n[#19](https://github.com/marten-de-vries/kneden/issues/19) for more information.\n\n### Via `.babelrc` (Recommended)\n\n**.babelrc**\n\n```json\n{\n  \"plugins\": [\"async-to-promises\"]\n}\n```\n\n### Via CLI\n\n```sh\n$ babel --plugins async-to-promises script.js\n```\n\n### Via Node API\n\n```javascript\nrequire(\"babel-core\").transform(\"code\", {\n  plugins: [\"async-to-promises\"]\n});\n```\n\nYou can also use the plug-in in [Browserify](http://browserify.org/) using\n[babelify](https://github.com/babel/babelify), in [Rollup](http://rollupjs.org/)\nby using it in conjunction with\n[rollup-plugin-babel](https://github.com/rollup/rollup-plugin-babel), and in\n[Webpack](https://webpack.github.io/) using\n[babel-loader](https://github.com/babel/babel-loader).\n\nUnsupported\n-----------\n\n- Return statements aren't properly supported in switch and try/catch/finally\n  statements yet ([#13](https://github.com/marten-de-vries/kneden/issues/13))\n- No ``eval()``; but that's true for other Babel plugins/presets as well.\n\nContributing\n------------\n\nThere are a couple of ways to contribute, for example by:\n\n- Reporting test results with your code base\n- Fixing bugs, for a nice starting task see the ones labeled '[good first bug](https://github.com/marten-de-vries/kneden/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+bug%22)'.\n\nContributions are very welcome! Just open an issue or PR.\n\nWhat's up with the name?\n------------------------\n\nIt's Dutch for 'to knead'/'to mold' - the program molds ES7 async/await\nconstructs into promises. It seemed applicable. [Pronounciation](https://upload.wikimedia.org/wikipedia/commons/0/0e/Nl-kneden.ogg).\n\nThe npm package name is a more descriptive one as explained in\n[issue #22](https://github.com/marten-de-vries/kneden/issues/22).\n\nLicense\n-------\n\nISC\n\n---\n\n**Kneden** is a project by [Marten de Vries](https://ma.rtendevri.es/).\n","maintainers":[{"name":"commandoline","email":"marten@marten-de-vries.nl"},{"name":"hzoo","email":"hi@henryzoo.com"}],"time":{"modified":"2022-06-13T04:00:32.883Z","created":"2016-03-25T15:01:54.826Z","1.0.3":"2016-03-25T15:01:54.826Z","1.0.4":"2016-03-25T15:13:50.271Z","1.0.5":"2016-04-24T14:12:58.278Z"},"homepage":"https://github.com/marten-de-vries/kneden#readme","keywords":["es","7","6","babel","promise","async","await","promises","function","functions","plugin","babel-plugin"],"repository":{"type":"git","url":"git+https://github.com/marten-de-vries/kneden.git"},"author":{"name":"Marten de Vries"},"bugs":{"url":"https://github.com/marten-de-vries/kneden/issues"},"license":"ISC","readmeFilename":"README.md","users":{"usex":true,"meeh":true}}