{"_id":"@aeichacker/babel-plugin-transform-async-to-promises","_rev":"2-0a67c14b4627be3cd878fa2579ef6861","name":"@aeichacker/babel-plugin-transform-async-to-promises","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@aeichacker/babel-plugin-transform-async-to-promises","version":"0.1.0","keywords":["async","await","optimization","babel","compile","transform","minify"],"author":{"name":"Ryan Petrich","email":"rpetrich@gmail.com"},"license":"MIT","_id":"@aeichacker/babel-plugin-transform-async-to-promises@0.1.0","maintainers":[{"name":"aeichacker","email":"wikkawikka@gmail.com"}],"homepage":"https://github.com/WikkaWikka/babel-plugin-transform-async-to-promises#readme","bugs":{"url":"https://github.com/WikkaWikka/babel-plugin-transform-async-to-promises/issues"},"dist":{"shasum":"aacfccac24773ae561ca95aedafe0a99824d5b56","tarball":"https://registry.npmjs.org/@aeichacker/babel-plugin-transform-async-to-promises/-/babel-plugin-transform-async-to-promises-0.1.0.tgz","fileCount":8,"integrity":"sha512-oQkZsFnD8T4Binuh/z3yOvRd2QDmR64v0k6U9f7ObpGXMt2GyBDSytzmeZYQq6jaLlRA+UAV4RNVpWLU5XvkkQ==","signatures":[{"sig":"MEUCIHZpVIzHmmU9YS/ZM82PRkZkJe8zIq2p8YQlzodSLDlvAiEA0nhaskqkVXeXE6tNq63Dr1Eu91xR3QvnTVuIUxBgNOI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":406737},"main":"async-to-promises.js","gitHead":"737f912872ea1fd99d938cbfc8f64667a157886b","scripts":{"test":"jest && prettier -c async-to-promises.ts async-to-promises.test.js","format":"prettier --write async-to-promises.ts async-to-promises.test.js","prepare":"tsc && node ./generate-helpers-string.js","test:coverage":"jest --coverage"},"_npmUser":{"name":"aeichacker","email":"wikkawikka@gmail.com"},"repository":{"url":"git+https://github.com/rpetrich/babel-plugin-transform-async-to-promises.git","type":"git"},"_npmVersion":"10.7.0","description":"Transform async/await to promise chains; fork of https://github.com/rpetrich/babel-plugin-transform-async-to-promises","directories":{},"_nodeVersion":"22.2.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","prettier":"2.5.1","babel-core":"^6.26.3","typescript":"^4.5.4","@babel/core":"^7.16.5","@types/node":"^16.11.13","@babel/types":"^7.16.0","babel-traverse":"^6.26.0","@babel/traverse":"^7.16.5","babel-preset-env":"^1.7.0","@babel/preset-env":"^7.16.5","@types/babel-types":"^7.0.11","@types/babel-traverse":"^6.25.7","babel-plugin-external-helpers":"^6.22.0","@babel/plugin-external-helpers":"^7.16.5","@babel/plugin-transform-classes":"^7.16.5","@babel/plugin-transform-parameters":"^7.16.5","@babel/plugin-proposal-class-properties":"^7.16.5","babel-plugin-transform-class-properties":"^6.24.1","@babel/plugin-transform-modules-commonjs":"^7.16.5","@babel/plugin-transform-modules-systemjs":"^7.16.5","babel-plugin-transform-es2015-parameters":"^6.24.1","babel-plugin-transform-es2015-modules-commonjs":"^6.26.2"},"_npmOperationalInternal":{"tmp":"tmp/babel-plugin-transform-async-to-promises_0.1.0_1752247996530_0.6665011313991673","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"_id":"@aeichacker/babel-plugin-transform-async-to-promises@0.1.1","bugs":{"url":"https://github.com/WikkaWikka/babel-plugin-transform-async-to-promises/issues"},"dist":{"shasum":"72bf8a4ee57363c1a8a589dcb00ae044224d9322","tarball":"https://registry.npmjs.org/@aeichacker/babel-plugin-transform-async-to-promises/-/babel-plugin-transform-async-to-promises-0.1.1.tgz","fileCount":8,"integrity":"sha512-UDoAskx56hIbuf0kmDJeJlmvZ6BieTeqJBVM9LPXV2MIaWeEOZ9LzDdVnLrIQmcoR1AamTDv3E2NiSNQz8SLvQ==","signatures":[{"sig":"MEUCIQDl5yL/aN+OyqOZ5/lzCz3vLMACDAyhacQjYO4yyfjt0AIgPoUD32itaeZx/7wUwg0qW8YHWPGA2YNhfEpiHIY7WJU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCZRyyNMYL8tYqKRoe5IBlzpGcVtwJhe0MsxjDN1defiAIhAK54dDmJTsARP57dz1tyExHEzg2os3iDIs8m4rUrXRuF"}],"unpackedSize":408554},"main":"async-to-promises.js","name":"@aeichacker/babel-plugin-transform-async-to-promises","_from":"file:aeichacker-babel-plugin-transform-async-to-promises-0.1.1.tgz","author":{"name":"Ryan Petrich","email":"rpetrich@gmail.com"},"license":"MIT","scripts":{"test":"jest && prettier -c async-to-promises.ts async-to-promises.test.js","format":"prettier --write async-to-promises.ts async-to-promises.test.js","prepare":"tsc && node ./generate-helpers-string.js","test:coverage":"jest --coverage"},"version":"0.1.1","_npmUser":{"name":"aeichacker","email":"wikkawikka@gmail.com"},"homepage":"https://github.com/WikkaWikka/babel-plugin-transform-async-to-promises#readme","keywords":["async","await","optimization","babel","compile","transform","minify"],"_resolved":"/Users/aeichacker/repos/babel-plugin-transform-async-to-promises/aeichacker-babel-plugin-transform-async-to-promises-0.1.1.tgz","_integrity":"sha512-UDoAskx56hIbuf0kmDJeJlmvZ6BieTeqJBVM9LPXV2MIaWeEOZ9LzDdVnLrIQmcoR1AamTDv3E2NiSNQz8SLvQ==","repository":{"url":"git+https://github.com/rpetrich/babel-plugin-transform-async-to-promises.git","type":"git"},"_npmVersion":"10.7.0","description":"Transform async/await to promise chains; fork of https://github.com/rpetrich/babel-plugin-transform-async-to-promises","directories":{},"maintainers":[{"name":"aeichacker","email":"wikkawikka@gmail.com"}],"_nodeVersion":"22.2.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","prettier":"2.5.1","babel-core":"^6.26.3","typescript":"^4.5.4","@babel/core":"^7.16.5","@types/node":"^16.11.13","@babel/types":"^7.16.0","babel-traverse":"^6.26.0","@babel/traverse":"^7.16.5","babel-preset-env":"^1.7.0","@babel/preset-env":"^7.16.5","@types/babel-types":"^7.0.11","@types/babel-traverse":"^6.25.7","babel-plugin-external-helpers":"^6.22.0","@babel/plugin-external-helpers":"^7.16.5","@babel/plugin-transform-classes":"^7.16.5","@babel/plugin-transform-parameters":"^7.16.5","@babel/plugin-proposal-class-properties":"^7.16.5","babel-plugin-transform-class-properties":"^6.24.1","@babel/plugin-transform-modules-commonjs":"^7.16.5","@babel/plugin-transform-modules-systemjs":"^7.16.5","babel-plugin-transform-es2015-parameters":"^6.24.1","babel-plugin-transform-es2015-modules-commonjs":"^6.26.2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/babel-plugin-transform-async-to-promises_0.1.1_1790968921869_0.7920290638322742"}}},"time":{"created":"2025-07-11T15:33:16.402Z","modified":"2026-10-02T19:22:02.112Z","0.1.0":"2025-07-11T15:33:16.705Z","0.1.1":"2026-10-02T19:22:01.958Z"},"bugs":{"url":"https://github.com/WikkaWikka/babel-plugin-transform-async-to-promises/issues"},"author":{"name":"Ryan Petrich","email":"rpetrich@gmail.com"},"license":"MIT","homepage":"https://github.com/WikkaWikka/babel-plugin-transform-async-to-promises#readme","keywords":["async","await","optimization","babel","compile","transform","minify"],"repository":{"url":"git+https://github.com/rpetrich/babel-plugin-transform-async-to-promises.git","type":"git"},"description":"Transform async/await to promise chains; fork of https://github.com/rpetrich/babel-plugin-transform-async-to-promises","maintainers":[{"name":"aeichacker","email":"wikkawikka@gmail.com"}],"readme":"Forked to layer some additional functionality and bug fixes.\n\nSee https://github.com/rpetrich/babel-plugin-transform-async-to-promises\n\n========================================\nbabel-plugin-transform-async-to-promises\n========================================\n\nBabel plugin to transform `async` functions containing `await` expressions to the equivalent chain of `Promise` calls with use of minimal helper functions.\n\n### Input:\n\n```javascript\nasync function fetchAsObjectURL(url) {\n    const response = await fetch(url);\n    const blob = await response.blob();\n    return URL.createObjectURL(blob);\n}\n```\n\n### Output:\n\n```javascript\nconst fetchAsObjectURL = _async(function(url) {\n\treturn _await(fetch(url), function(response) {\n\t\treturn _await(response.blob(), URL.createObjectURL);\n\t});\n});\n```\n\n### Output with `hoist` enabled:\n\n```javascript\nfunction _response$blob(response) {\n\treturn _await(response.blob(), URL.createObjectURL);\n}\nconst fetchAsObjectURL = _async(function(url) {\n\treturn _await(fetch(url), _response$blob);\n});\n```\n\n### Output with `inlineHelpers` enabled:\n\n```javascript\nconst fetchAsObjectURL = function(url) {\n\ttry {\n\t\treturn Promise.resolve(fetch(url)).then(function(response) {\n\t\t\treturn Promise.resolve(response.blob()).then(URL.createObjectURL);\n\t\t});\n\t} catch(e) {\n\t\treturn Promise.reject(e);\n\t}\n}\n```\n\n### Output with `externalHelpers` enabled:\n\nIn the normal case, helpers are added to the top of the file for the `_async` and `_await` functions (as well as others). This can cause bloat in a codebase due to duplication of helper code in every file. To avoid this, enable `externalHelpers` and those will be imported instead:\n\n```javascript\nimport { _async } from \"babel-plugin-transform-async-to-promises/helpers\";\nimport { _await } from \"babel-plugin-transform-async-to-promises/helpers\";\n\nconst fetchAsObjectURL = _async(function(url) {\n\treturn _await(fetch(url), function(response) {\n\t\treturn _await(response.blob(), URL.createObjectURL);\n\t});\n});\n\nexport default fetchAsObjectURL;\n```\n\n## JavaScript Language Features\n\n### Full Support\n- `async`/`await`\n- `for`/`while`/`do` loops (including loops that would exhaust stack if dispatched recursively)\n- `switch` statements (including fallthrough and `default` cases)\n- conditional expressions\n- logical expressions\n- `try`/`catch`\n- `break`/`continue` statements (on both loops and labeled statements)\n- `throw` expressions\n- Function hoisting\n- Variable hoisting\n- Arrow functions\n- Methods\n- `arguments`\n- `this`\n- Proper member dereference order of operations\n- Standards-compliant event loop scheduling\n\n### Partial Support\n- `Function.length`: `async` functions will often return a length of 0 (when the `_async` wrapper is used)\n- Top level await support is experimental with compatible module bundler. Set `topLevelAwait` option to `return` when using SystemJS.\n\n### No support\n- `eval`: impossible to support without deep hooks into the runtime\n- Async generator functions: not implemented or planned\n- `Function.name`: rewrite pass removes function name instrumentation\n- `new AsyncFunction(...)`: impossible to support without shipping babel and the plugin in the output\n","readmeFilename":"README.md"}