183 breaking releases

new 0.186.0 Jan 16, 2025
0.184.0 Dec 19, 2024
0.180.0 Nov 28, 2024
0.164.0 Jul 31, 2024
0.2.0 Mar 21, 2021

#1509 in Web programming

Download history 4901/week @ 2024-09-27 3818/week @ 2024-10-04 4223/week @ 2024-10-11 4372/week @ 2024-10-18 4020/week @ 2024-10-25 4218/week @ 2024-11-01 4187/week @ 2024-11-08 4008/week @ 2024-11-15 4447/week @ 2024-11-22 4578/week @ 2024-11-29 5097/week @ 2024-12-06 4987/week @ 2024-12-13 2345/week @ 2024-12-20 1814/week @ 2024-12-27 3238/week @ 2025-01-03 4243/week @ 2025-01-10

12,345 downloads per month
Used in 62 crates (23 directly)

MIT license

110KB
3K SLoC

JavaScript 3K SLoC // 0.1% comments TypeScript 33 SLoC // 0.2% 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

~86MB
~1.5M SLoC