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

#412 in WebAssembly

Download history 12501/week @ 2023-12-13 10329/week @ 2023-12-20 8480/week @ 2023-12-27 13973/week @ 2024-01-03 15564/week @ 2024-01-10 13478/week @ 2024-01-17 13770/week @ 2024-01-24 13636/week @ 2024-01-31 14202/week @ 2024-02-07 13398/week @ 2024-02-14 13869/week @ 2024-02-21 14563/week @ 2024-02-28 13844/week @ 2024-03-06 13831/week @ 2024-03-13 16527/week @ 2024-03-20 12704/week @ 2024-03-27

59,592 downloads per month
Used in 106 crates (17 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

~6.5–9MB
~177K SLoC