173 breaking releases

new 0.176.0 Nov 6, 2024
0.174.0 Oct 25, 2024
0.164.0 Jul 31, 2024
0.143.0 Mar 28, 2024
0.2.0 Mar 21, 2021

#1755 in Web programming

Download history 5602/week @ 2024-07-19 4988/week @ 2024-07-26 3636/week @ 2024-08-02 3542/week @ 2024-08-09 3313/week @ 2024-08-16 4929/week @ 2024-08-23 3976/week @ 2024-08-30 4133/week @ 2024-09-06 3584/week @ 2024-09-13 4956/week @ 2024-09-20 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 3183/week @ 2024-11-01

16,531 downloads per month
Used in 59 crates (22 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

~85MB
~1.5M SLoC