#wasm-bindgen #javascript #promise #future #bridging

no-std wasm-bindgen-futures

Bridging the gap between Rust Futures and JavaScript Promises

106 releases

0.4.72 May 22, 2026
0.4.70 Apr 28, 2026
0.4.67 Mar 31, 2026
0.4.56 Nov 28, 2025
0.3.5 Nov 12, 2018

#6 in #promise

Download history 603883/week @ 2026-03-03 3749251/week @ 2026-03-10 3318265/week @ 2026-03-17 3231727/week @ 2026-03-24 3397018/week @ 2026-03-31 3686433/week @ 2026-04-07 3822359/week @ 2026-04-14 3999581/week @ 2026-04-21 4216799/week @ 2026-04-28 4658598/week @ 2026-05-05 5499068/week @ 2026-05-12 5327672/week @ 2026-05-19 5343487/week @ 2026-05-26 4640749/week @ 2026-06-02

21,596,946 downloads per month
Used in 47,047 crates (1,877 directly)

MIT/Apache

725KB
9K SLoC

wasm-bindgen-futures

API Documentation

This crate bridges the gap between Rust Futures and JavaScript Promises.

As of this version the implementation lives in js-sys under the futures feature. Depending on this crate automatically activates that feature, which gives js_sys::Promise a first-class IntoFuture implementation — meaning you can .await any Promise directly:

use js_sys::Promise;
use wasm_bindgen::prelude::*;

async fn example(promise: Promise) -> Result<JsValue, JsValue> {
    promise.await
}

All public items from the previous API are re-exported unchanged for backwards compatibility:

Under the feature flag futures-core-03-stream there is support for AsyncIterator to Stream conversion via JsStream.

See the API documentation for more info.

Dependencies

~0.4–1MB
~20K SLoC