5 unstable releases

0.3.0 Aug 11, 2023
0.2.3 Aug 21, 2022
0.2.1 Nov 25, 2021
0.2.0 Oct 24, 2021
0.1.0 Jul 28, 2021

#1391 in WebAssembly

Download history 14116/week @ 2024-11-18 15226/week @ 2024-11-25 14949/week @ 2024-12-02 13219/week @ 2024-12-09 12767/week @ 2024-12-16 8923/week @ 2024-12-23 9454/week @ 2024-12-30 14300/week @ 2025-01-06 15333/week @ 2025-01-13 14013/week @ 2025-01-20 13976/week @ 2025-01-27 17225/week @ 2025-02-03 15760/week @ 2025-02-10 14212/week @ 2025-02-17 15659/week @ 2025-02-24 12079/week @ 2025-03-03

59,464 downloads per month
Used in 110 crates (20 directly)

MIT/Apache

31KB
450 lines

gloo-console

Crates.io version Download docs.rs docs

API Docs | Contributing | Chat

Built with 🦀🕸 by The Rust and WebAssembly Working Group

The JavaScript's console object provides access to the browser's console. Using the console object in Rust/WASM directly is cumbersome as it requires JavaScript glue code. This crate exists to solve this problem by providing a set of ergonomic Rust APIs to deal with the browser console.

Example

The following example logs text to the console using console.log

use gloo_console::log;
let object = JsValue::from("any JsValue can be logged");
log!("text", object);

Dependencies

~7–10MB
~186K SLoC