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

#411 in Profiling

Download history 15492/week @ 2024-08-03 17225/week @ 2024-08-10 14583/week @ 2024-08-17 15365/week @ 2024-08-24 14871/week @ 2024-08-31 14910/week @ 2024-09-07 12764/week @ 2024-09-14 15118/week @ 2024-09-21 17146/week @ 2024-09-28 13576/week @ 2024-10-05 15263/week @ 2024-10-12 16689/week @ 2024-10-19 15263/week @ 2024-10-26 14506/week @ 2024-11-02 12230/week @ 2024-11-09 13967/week @ 2024-11-16

58,527 downloads per month
Used in 107 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.5–10MB
~185K SLoC