For AI agents: the complete documentation index is available at /tc39-atlas/en/llms.txt, the full documentation bundle is available at /tc39-atlas/en/llms-full.txt, and this page is available as Markdown at /tc39-atlas/en/proposals/year/2017/proposal-async-await.md.
  • English
  • Async functions S4

    Proposal details
    Proposal overview

    This proposal introduces async functions to ECMAScript, aiming to simplify writing asynchronous code by combining Promises and Generators. It provides a language-level model for async operations, with an implementation in regenerator for compiling async/await code to ES5. The proposal has a complete spec text and is implemented in regenerator, indicating a mature stage.

    Note

    The README below comes from the upstream repository and may contain outdated stage or status metadata. Use the proposal details above as the current source of truth.

    Async Functions for ECMAScript

    The introduction of Promises and Generators in ECMAScript presents an opportunity to dramatically improve the language-level model for writing asynchronous code in ECMAScript. The spec text can be found here.

    This proposal is implemented in a regenerator which can compile ES5 code containing async and await down to vanilla ES5 to run in existing browsers and runtimes.

    This repo contains a complete example using a large number of the features of the proposal. To run this example:

    npm install
    regenerator -r server.asyncawait.js | node