#binding-generator #js #javascript

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

71 releases

new 0.3.61 Feb 1, 2023
0.3.60 Sep 12, 2022
0.3.59 Jul 25, 2022
0.3.56 Jan 19, 2022
0.2.0 Jul 26, 2018

#201 in WebAssembly

Download history 395078/week @ 2022-10-14 402800/week @ 2022-10-21 389274/week @ 2022-10-28 400455/week @ 2022-11-04 392972/week @ 2022-11-11 366615/week @ 2022-11-18 376877/week @ 2022-11-25 397186/week @ 2022-12-02 396341/week @ 2022-12-09 385638/week @ 2022-12-16 258678/week @ 2022-12-23 328315/week @ 2022-12-30 421150/week @ 2023-01-06 393173/week @ 2023-01-13 414270/week @ 2023-01-20 374793/week @ 2023-01-27

1,670,382 downloads per month
Used in 19,053 crates (646 directly)

MIT/Apache

480KB
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.1MB
~22K SLoC