186 breaking releases

0.189.0 Jan 31, 2025
0.187.0 Jan 22, 2025
0.184.0 Dec 19, 2024
0.180.0 Nov 28, 2024
0.2.0 Mar 21, 2021

#1912 in Web programming

Download history 4405/week @ 2024-10-19 3790/week @ 2024-10-26 4350/week @ 2024-11-02 4070/week @ 2024-11-09 4240/week @ 2024-11-16 4217/week @ 2024-11-23 4698/week @ 2024-11-30 4865/week @ 2024-12-07 4898/week @ 2024-12-14 2169/week @ 2024-12-21 1869/week @ 2024-12-28 3613/week @ 2025-01-04 5702/week @ 2025-01-11 5401/week @ 2025-01-18 5798/week @ 2025-01-25 3588/week @ 2025-02-01

21,218 downloads per month
Used in 60 crates (24 directly)

MIT license

115KB
3K SLoC

JavaScript 3K SLoC // 0.1% comments TypeScript 33 SLoC // 0.9% comments Rust 30 SLoC

deno_console

This crate implements the Console API.

Spec: https://console.spec.whatwg.org/

Usage Example

From javascript, include the extension's source, and assign a console to the global scope:

import * as console from "ext:deno_console/01_console.js";
Object.defineProperty(globalThis, "console", {
  value: new console.Console((msg, level) =>
    globalThis.Deno.core.print(msg, level > 1)
  ),
  enumerable: false,
  configurable: true,
  writable: true,
});

Then from rust, provide deno_console::deno_console::init_ops_and_esm() in the extensions field of your RuntimeOptions

Provided ops

Following ops are provided, which can be accessed through Deno.ops:

  • op_preview_entries

Dependencies

~91MB
~2M SLoC