#binding-generator #js #javascript #wasm-bindgen #browser #global #bindings #node-js #handwritten

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

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

#145 in WebAssembly

Download history 394354/week @ 2022-12-10 373993/week @ 2022-12-17 248485/week @ 2022-12-24 352216/week @ 2022-12-31 422655/week @ 2023-01-07 401576/week @ 2023-01-14 411361/week @ 2023-01-21 447306/week @ 2023-01-28 466803/week @ 2023-02-04 473870/week @ 2023-02-11 464780/week @ 2023-02-18 478706/week @ 2023-02-25 512565/week @ 2023-03-04 499460/week @ 2023-03-11 508564/week @ 2023-03-18 429960/week @ 2023-03-25

2,021,405 downloads per month
Used in 20,832 crates (678 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

~1.1–1.6MB
~36K SLoC