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

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

86 releases

new 0.3.76 Dec 7, 2024
0.3.74 Nov 30, 2024
0.3.69 Mar 4, 2024
0.3.66 Nov 27, 2023
0.2.0 Jul 26, 2018

#7 in WebAssembly

Download history 1317894/week @ 2024-08-19 1254769/week @ 2024-08-26 1213339/week @ 2024-09-02 1255716/week @ 2024-09-09 1142561/week @ 2024-09-16 1261280/week @ 2024-09-23 1235083/week @ 2024-09-30 1317845/week @ 2024-10-07 1305838/week @ 2024-10-14 1337686/week @ 2024-10-21 1282029/week @ 2024-10-28 1296287/week @ 2024-11-04 1275743/week @ 2024-11-11 1257860/week @ 2024-11-18 1102725/week @ 2024-11-25 1234114/week @ 2024-12-02

4,931,798 downloads per month
Used in 37,377 crates (1,189 directly)

MIT/Apache

500KB
6K 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
~23K SLoC