187 breaking releases

new 0.190.0 Feb 13, 2025
0.188.0 Jan 30, 2025
0.184.0 Dec 19, 2024
0.180.0 Nov 28, 2024
0.2.0 Mar 21, 2021

#1814 in Web programming

Download history 3784/week @ 2024-10-28 4566/week @ 2024-11-04 3977/week @ 2024-11-11 4492/week @ 2024-11-18 4099/week @ 2024-11-25 4623/week @ 2024-12-02 4905/week @ 2024-12-09 4861/week @ 2024-12-16 1895/week @ 2024-12-23 1940/week @ 2024-12-30 4442/week @ 2025-01-06 5530/week @ 2025-01-13 5251/week @ 2025-01-20 5436/week @ 2025-01-27 5138/week @ 2025-02-03 5363/week @ 2025-02-10

21,746 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