{"id":13740114,"url":"https://github.com/ziolko/babel-plugin-auto-await","last_synced_at":"2025-08-18T19:05:25.385Z","repository":{"id":69753019,"uuid":"109618885","full_name":"ziolko/babel-plugin-auto-await","owner":"ziolko","description":"Automatically await every expression in async function","archived":false,"fork":false,"pushed_at":"2019-02-25T18:21:53.000Z","size":8,"stargazers_count":27,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-01T21:46:24.464Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ziolko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-05T21:41:23.000Z","updated_at":"2024-05-13T12:52:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"f1a2f8ad-dd73-40fa-b67e-4db9bf58fdcf","html_url":"https://github.com/ziolko/babel-plugin-auto-await","commit_stats":{"total_commits":9,"total_committers":2,"mean_commits":4.5,"dds":"0.11111111111111116","last_synced_commit":"ee290539a5cee4ebe2c3dbedab7db6965a5f63d3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ziolko/babel-plugin-auto-await","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziolko%2Fbabel-plugin-auto-await","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziolko%2Fbabel-plugin-auto-await/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziolko%2Fbabel-plugin-auto-await/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziolko%2Fbabel-plugin-auto-await/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ziolko","download_url":"https://codeload.github.com/ziolko/babel-plugin-auto-await/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziolko%2Fbabel-plugin-auto-await/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271043515,"owners_count":24689770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T04:00:42.813Z","updated_at":"2025-08-18T19:05:25.332Z","avatar_url":"https://github.com/ziolko.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Syntax Sugar"],"readme":"# Write JS code as if it was synchronous\nES7 introduced `async` and `await` which are great. While working with them I've found that `await` is usually superfluous. This babel plugin automatically puts `await` in front of every function call in `async` functions. In the result the code looks like if JS was synchronous.\n\n## Example\n```javascript\nconst axios = require('axios')\n\nasync function loadAndParseData () {\n  // Because this function is marked as async we\n  // automatically await all promises\n\n  const url = 'https://api.github.com/users/ziolko'\n  const { data: user } = axios.get(url)\n  const { data: repos } = axios.get(user.repos_url)\n\n  // This function is not async, so it's not touched\n  function getRepoName(repo) {\n    return repo.nam\n  }\n\n  return repos.map(getRepoName)\n}\n\nloadAndParseData().then(console.log)\n```\n\n## Use cases\nThis plugin was valuable for me in integration tests and nodejs utility scripts. See [examples](https://github.com/ziolko/babel-plugin-auto-await/tree/master/examples) for working code.\n\n## Installation\n`npm install --save-dev babel-plugin-auto-await`\n\n## Usage\n### Via .babelrc (Recommended)\n###### .babelrc\n```json\n{\n  \"plugins\": [\"auto-await\"]\n}\n```\n\n### Via CLI\n`babel-node --plugins auto-await script.js`\n\n### Via Node API\n```javascript\nrequire(\"babel-core\").transform(\"code\", {\n  plugins: [\"auto-await\"]\n});\n```\n\n## Gotchas\nIf you don't understand how `Promise`, `async` and `await` work read [this tutorial](https://medium.com/@reasoncode/javascript-es8-introducing-async-await-functions-7a471ec7de8a) first.\n\n# License\nhttps://opensource.org/licenses/MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziolko%2Fbabel-plugin-auto-await","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fziolko%2Fbabel-plugin-auto-await","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziolko%2Fbabel-plugin-auto-await/lists"}