Draft specification for a proposed Array.fromAsync method in JavaScript.
Browse cluster: WebAssembly Specification and Proposals →This repository contains a draft specification for a proposed `Array.fromAsync` method in JavaScript, authored by J. S. Choi and presented as an ECMAScript Stage 4 proposal (conditional on editor review) from 2021–2025. The project addresses the problem domain of JavaScript language standardization, specifically filling a gap where no async equivalent exists for the widely-used `Array.from` method. `Array.fromAsync` would enable developers to convert async iterables, sync iterables that yield promises, and array-like objects into arrays via an awaitable promise, with optional mapping and `this`-binding parameters similar to `Array.from`. The proposal includes formal specification documentation, experimental polyfills available through NPM packages (`array-from-async` and `core-js`), and detailed examples demonstrating behavior in areas like lazy iteration, error handling, and interaction with the mapping callback parameter.