182 breaking releases

new 0.185.0 Jan 9, 2025
0.184.0 Dec 19, 2024
0.183.0 Dec 17, 2024
0.180.0 Nov 28, 2024
0.2.0 Mar 21, 2021

#1509 in Web programming

Download history 5029/week @ 2024-09-21 4768/week @ 2024-09-28 3889/week @ 2024-10-05 4396/week @ 2024-10-12 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 2705/week @ 2025-01-04

12,205 downloads per month
Used in 63 crates (24 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

~85MB
~1.5M SLoC