deno.com
在当前页面

API 参考

这是 Deno Deploy 上可用的运行时 API 的参考。此 API 与标准的 运行时 API 非常相似,但由于 Deno Deploy 是一个无服务器环境,某些 API 的可用性有所不同。

请使用本文档的此部分来探索 Deno Deploy 上可用的 API。

Web API Jump to heading

Deno API Jump to heading

注意:在 Deploy 中仅提供 Deno 的稳定 API。

  • Deno.env - 与环境变量(密钥)交互。
    • get(key: string): string | undefined - 获取环境变量的值。
    • toObject(): { [key: string]: string } - 将所有环境变量作为对象获取。
  • Deno.connect - 连接到 TCP 套接字。
  • Deno.connectTls - 使用 TLS 连接到 TCP 套接字。
  • Deno.startTls - 从现有的 TCP 连接启动 TLS 握手。
  • Deno.resolveDns - 进行 DNS 查询
  • 文件系统 API

未来支持 Jump to heading

未来将添加以下 API:

  • Cache API
  • UDP API:
    • Deno.connectDatagram 用于出站 UDP 套接字
  • 使用 Deno.createHttpClient 自定义 fetch 选项

限制 Jump to heading

与 Deno CLI 一样,我们没有实现 ECMA Script 附录 B 中指定的 __proto__ 对象字段。

你找到需要的内容了吗?

隐私政策