Skip to content

Top-level await

module.mjs
const data = await fetch("/api").then(r => r.json());
export default data;

Notes

  • Only in ES modules; consider module graph blocking.