#mozilla-org #javascript #js-bindings

no-std js-sys

Bindings for all JS global objects and functions in all JS environments like Node.js and browsers, built on #[wasm_bindgen] using the wasm-bindgen crate

98 releases

0.3.91 Feb 27, 2026
0.3.85 Jan 15, 2026
0.3.83 Nov 28, 2025
0.3.77 Jan 12, 2025
0.2.0 Jul 26, 2018

#12 in WebAssembly

Download history 3405917/week @ 2025-11-18 2559195/week @ 2025-11-25 3403805/week @ 2025-12-02 3669301/week @ 2025-12-09 3402739/week @ 2025-12-16 1750742/week @ 2025-12-23 1933578/week @ 2025-12-30 3570687/week @ 2026-01-06 3818952/week @ 2026-01-13 4204840/week @ 2026-01-20 4137402/week @ 2026-01-27 4302684/week @ 2026-02-03 4338903/week @ 2026-02-10 4464641/week @ 2026-02-17 4883944/week @ 2026-02-24 5487974/week @ 2026-03-03

19,871,380 downloads per month
Used in 65,671 crates (2,098 directly)

MIT/Apache

1MB
11K SLoC

Bindings to JavaScript's standard, built-in objects, including their methods and properties.

This does not include any Web, Node, or any other JS environment APIs. Only the things that are guaranteed to exist in the global scope by the ECMAScript standard.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects

A Note About camelCase, snake_case, and Naming Conventions

JavaScript's global objects use camelCase naming conventions for functions and methods, but Rust style is to use snake_case. These bindings expose the Rust style snake_case name. Additionally, acronyms within a method name are all lower case, where as in JavaScript they are all upper case. For example, decodeURI in JavaScript is exposed as decode_uri in these bindings.

A Note About toString and to_js_string

JavaScript's toString() method is exposed as to_js_string() in these bindings to avoid confusion with Rust's ToString trait and its to_string() method. This allows types to implement both the Rust Display trait (which provides to_string() via ToString) and still expose the JavaScript toString() functionality.


js-sys

Raw bindings to JS global APIs for projects using wasm-bindgen. This crate is handwritten and intended to work in all JS environments like browsers and Node.js.

Documentation

Dependencies

~0.4–1MB
~19K SLoC