#binding-generator #webassembly

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

76 releases

new 0.3.66 Nov 27, 2023
0.3.64 Jun 12, 2023
0.3.61 Feb 1, 2023
0.3.60 Sep 12, 2022
0.2.0 Jul 26, 2018

#139 in WebAssembly

Download history 561691/week @ 2023-08-13 622979/week @ 2023-08-20 644176/week @ 2023-08-27 639020/week @ 2023-09-03 694722/week @ 2023-09-10 694413/week @ 2023-09-17 696964/week @ 2023-09-24 717457/week @ 2023-10-01 724287/week @ 2023-10-08 792219/week @ 2023-10-15 764745/week @ 2023-10-22 839093/week @ 2023-10-29 842213/week @ 2023-11-05 881983/week @ 2023-11-12 677905/week @ 2023-11-19 745785/week @ 2023-11-26

3,201,461 downloads per month
Used in 26,477 crates (921 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.7–1.3MB
~27K SLoC