Registry / other / js-sys

js-sys

JSON →
library0.3.102rscratesunverified

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.

# Cargo.toml [dependencies] js-sys = "0.3.102"
INSTALL
IMPORT
SIG · JS-SYS
J
js-sys
otherrustv0.3.102
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

console
use js_sys::console;

Log a message to the browser console using js-sys.

use js_sys::console; fn main() { console::log_1(&"Hello from Rust!".into()); }
Debug
Known issues
gotchaRequires wasm32 target and wasm-bindgen runtime
fix
Compile with --target wasm32-unknown-unknown and use wasm-bindgen to generate JS glue
affects: >=0.2.0
Upgrade
Version history
0.3.102latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
js-sys — cargo add js-sys · libregistry