160 breaking releases

new 0.163.0 Jul 26, 2024
0.161.0 Jul 12, 2024
0.143.0 Mar 28, 2024
0.129.0 Dec 21, 2023
0.2.0 Mar 21, 2021

#10 in #spec

Download history 4122/week @ 2024-04-05 5208/week @ 2024-04-12 6200/week @ 2024-04-19 5021/week @ 2024-04-26 7026/week @ 2024-05-03 7080/week @ 2024-05-10 7584/week @ 2024-05-17 5869/week @ 2024-05-24 5013/week @ 2024-05-31 5418/week @ 2024-06-07 7604/week @ 2024-06-14 5376/week @ 2024-06-21 4700/week @ 2024-06-28 5282/week @ 2024-07-05 5419/week @ 2024-07-12 4721/week @ 2024-07-19

20,954 downloads per month
Used in 52 crates (21 directly)

MIT license

110KB
3K SLoC

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

~94MB
~2M SLoC