#object #nodejs #global #web #documentation #mozilla #developer

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

82 releases

0.3.72 Oct 10, 2024
0.3.70 Aug 12, 2024
0.3.69 Mar 4, 2024
0.3.66 Nov 27, 2023
0.2.0 Jul 26, 2018

#7 in WebAssembly

Download history 1187126/week @ 2024-07-18 1181997/week @ 2024-07-25 1145719/week @ 2024-08-01 1237229/week @ 2024-08-08 1287900/week @ 2024-08-15 1292148/week @ 2024-08-22 1167335/week @ 2024-08-29 1286835/week @ 2024-09-05 1220269/week @ 2024-09-12 1183937/week @ 2024-09-19 1260326/week @ 2024-09-26 1273226/week @ 2024-10-03 1297272/week @ 2024-10-10 1338813/week @ 2024-10-17 1335375/week @ 2024-10-24 1259751/week @ 2024-10-31

5,489,099 downloads per month
Used in 35,682 crates (1,166 directly)

MIT/Apache

490KB
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
~25K SLoC