#object #global #web #documentation #mozilla #developer #reference

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

79 releases

0.3.69 Mar 4, 2024
0.3.67 Jan 12, 2024
0.3.66 Nov 27, 2023
0.3.64 Jun 12, 2023
0.2.0 Jul 26, 2018

#8 in WebAssembly

Download history 827428/week @ 2023-12-07 790446/week @ 2023-12-14 501218/week @ 2023-12-21 565767/week @ 2023-12-28 826464/week @ 2024-01-04 884682/week @ 2024-01-11 944438/week @ 2024-01-18 880868/week @ 2024-01-25 965343/week @ 2024-02-01 958965/week @ 2024-02-08 930424/week @ 2024-02-15 1014364/week @ 2024-02-22 1014915/week @ 2024-02-29 1001658/week @ 2024-03-07 974717/week @ 2024-03-14 841710/week @ 2024-03-21

4,008,441 downloads per month
Used in 29,634 crates (993 directly)

MIT/Apache

495KB
5.5K SLoC

js-sys

API documentation

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.


lib.rs:

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.

Dependencies

~0.6–1.2MB
~26K SLoC