gloo-console

Crates.iogloo-console
lib.rsgloo-console
version0.3.0
sourcesrc
created_at2021-07-28 08:38:58.512662
updated_at2023-08-11 16:06:09.772995
descriptionConvenience crate for working with browser's console
homepagehttps://github.com/rustwasm/gloo
repositoryhttps://github.com/rustwasm/gloo/tree/master/crates/console
max_upload_size
id428221
size17,166
Elina (ranile)

documentation

https://docs.rs/gloo-console/

README

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);
Commit count: 376

cargo fmt