163次重大发布

新增 0.166.0 2024年8月22日
0.164.0 2024年7月31日
0.143.0 2024年3月28日
0.129.0 2023年12月21日
0.2.0 2021年3月21日

1771Web编程 中排名

Download history · Rust 包仓库 6549/week @ 2024-05-02 · Rust 包仓库 7025/week @ 2024-05-09 · Rust 包仓库 7260/week @ 2024-05-16 · Rust 包仓库 6193/week @ 2024-05-23 · Rust 包仓库 5336/week @ 2024-05-30 · Rust 包仓库 5297/week @ 2024-06-06 · Rust 包仓库 7491/week @ 2024-06-13 · Rust 包仓库 5813/week @ 2024-06-20 · Rust 包仓库 4844/week @ 2024-06-27 · Rust 包仓库 4725/week @ 2024-07-04 · Rust 包仓库 5955/week @ 2024-07-11 · Rust 包仓库 5508/week @ 2024-07-18 · Rust 包仓库 5080/week @ 2024-07-25 · Rust 包仓库 3663/week @ 2024-08-01 · Rust 包仓库 3780/week @ 2024-08-08 · Rust 包仓库 2789/week @ 2024-08-15 · Rust 包仓库

每月下载量 16,602
用于 53 个Crate(直接使用21个)

MIT 协议

110KB
3K SLoC

JavaScript 3K SLoC // 0.1% comments · Rust 包仓库 TypeScript 31 SLoC // 0.3% comments · Rust 包仓库 Rust 30 SLoC · Rust 包仓库

deno_console

此Crate实现了Console API。

规范: https://console.spec.whatwg.org/

使用示例

从javascript中,包含扩展的源,并将console分配给全局作用域

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,
});

然后从rust中,在您的 RuntimeOptionsextensions 字段中提供 deno_console::deno_console::init_ops_and_esm()

提供的操作

以下操作可通过 Deno.ops 访问

  • op_preview_entries

依赖

~84MB
~1.5M SLoC