← Back to release summary

Top-level await

Category
JavaScript
Type
New or changed feature
Status
Enabled by default (Chrome 89)
Intent stage
Shipped

Summary

Allow the `await` keyword at the top-level within JavaScript modules.

Motivation

Allows more seamless integration of async calls into the module loading process. Today this is accomplished by wrapping modules in async functions, but this pushes complexity into dependent modules and exposes implementation details.

Standards & signals

Docs: https://docs.google.com/document/d/15jxKo7kqj0bRHcnSmwjhj1XaWH1AXRDtYPiJHluCSiA/edit

Samples: See design doc.

Explainers: https://v8.dev/features/top-level-await https://github.com/tc39/proposal-top-level-await

View on chromestatus.com