deno.com
在本页中

Node API

Deno 为许多内置的 Node.js 模块和全局变量提供了 polyfill。

探索内置的 Node API

Node 兼容性是一个持续进行的项目 - 请帮助我们找出差距,并通过在 GitHub 上提交 issue告知我们您需要的模块。

完全支持的模块 (21/44) 跳转到标题

node:assert 跳转到标题

node:buffer 跳转到标题

node:child_process 跳转到标题

node:console 跳转到标题

node:crypto 跳转到标题

Certificate: 这些方法是非功能性占位符。

generateKeyPair: 不支持 x448 选项。

generatePrime: 不支持 safeaddrem 选项。

KeyObject: 以下是非功能性占位符

  • from
  • symmetricKeySize
  • equals
  • export

publicDecrypt: 此符号是非功能性占位符。

secureHeapUsed: 此符号是非功能性占位符。

setEngine: 此符号是非功能性占位符。

ECDH: convertKey 方法是非功能性占位符。

Sign: signverify 方法不支持非 BinaryLike 输入。

node:diagnostics_channel 跳转到标题

node:events 跳转到标题

node:fs 跳转到标题

writeFile: 缺少 utf16lelatin1ucs2 编码。

writeFileSync: 缺少 utf16lelatin1ucs2 编码。

node:fs/promises 跳转到标题

lchmod: lchmod 实现未实现。

node:module 跳转到标题

Module: register 方法是非功能性占位符。

node:os 跳转到标题

node:path 跳转到标题

node:punycode 跳转到标题

node:querystring 跳转到标题

node:readline 跳转到标题

node:sqlite 跳转到标题

此模块已在 Deno v2.2 中添加。

node:stream 跳转到标题

node:string_decoder 跳转到标题

node:timers 跳转到标题

node:tty 跳转到标题

node:url 跳转到标题

部分支持的模块 (17/44) 跳转到标题

node:async_hooks 跳转到标题

AsyncResource: AsyncResource 实现是非功能性占位符。

executionAsyncId: executionAsyncId 实现是非功能性占位符。

createHook: createHook 实现是非功能性占位符。

node:dgram 跳转到标题

Socket: 以下方法是非功能性占位符

  • addMembership
  • addSourceSpecificMembership
  • dropMembership
  • dropSourceSpecificMembership
  • setBroadcast
  • setMulticastInterface
  • setMulticastLoopback
  • setMulticastTtl
  • setTtl

node:dns 跳转到标题

resolve: 不支持 ttl 选项。

resolve4: 不支持 ttl 选项。

resolve6: 不支持 ttl 选项。

resolveCname: 不支持 ttl 选项。

resolveCaa: 不支持 ttl 选项。

resolveMx: 不支持 ttl 选项。

resolveNaptr: 不支持 ttl 选项。

resolveNs: 不支持 ttl 选项。

resolvePtr: 不支持 ttl 选项。

resolveSoa: 不支持 ttl 选项。

resolveSrv: 不支持 ttl 选项。

resolveTxt: 不支持 ttl 选项。

resolveAny: 不支持 ttl 选项。

node:http 跳转到标题

RequestOptions: 不支持 createConnection 选项。

ClientRequestArgs: 不支持 createConnection 选项。

ClientRequest: 构造函数选项 createConnection 不受支持。

request: 构造函数选项 createConnection 不受支持。

get: 构造函数选项 createConnection 不受支持。

node:http2 跳转到标题

Http2Session: 以下方法是非功能性占位符

  • setLocalWindowSize
  • ping
  • localSettings
  • remoteSettings
  • settings
  • ref
  • unref

ServerHttp2Session: 所有方法都是非功能性占位符。

Http2Stream: 以下方法是非功能性占位符

  • aborted
  • bufferSize
  • endAfterHeaders
  • id
  • pending
  • priority
  • rstCode
  • sentHeaders
  • sentInfoHeaders
  • sentTrailers
  • state

ClientHttp2Stream: 所有方法都是非功能性占位符。

getDefaultSettings: 此函数是非功能性占位符。

getPackedSettings: 此函数是非功能性占位符。

getUnpackedSettings: 此函数是非功能性占位符。

node:https 跳转到标题

Server: certkey 选项不支持数组输入。

node:inspector 跳转到标题

支持 console。其他 API 是非功能性占位符。

node:net 跳转到标题

Socket: 不支持 fd 选项。

node:perf_hooks 跳转到标题

performance: eventLoopUtilization 方法是非功能性占位符。timerify 方法未实现。

monitorEventLoopDelay: 此符号未实现。

node:process 跳转到标题

不支持 multipleResolvesworker 事件。

node:test 跳转到标题

目前仅支持 test API。

node:tls 跳转到标题

createSecurePair: 此符号目前不受支持。

node:util 跳转到标题

transferableAbortSignal: 此符号目前不受支持。

transferableAbortController: 此符号目前不受支持。

MIMEParams: 此符号目前不受支持。

MIMEType: 此符号目前不受支持。

getSystemErrorMap: 此符号目前不受支持。

node:v8 跳转到标题

支持 cachedDataVersionTaggetHeapStatisticsserializedeserializesetFlagsFromStrings 是空操作。其他 API 不受支持,将抛出错误。

setFlagsFromStrings: 此函数是空操作。

node:vm 跳转到标题

measureMemory: 这是非功能性占位符。

compile: 不支持 importModuleDynamically 参数。

createContext: 不支持 importModuleDynamically 参数。

Script: 不支持 importModuleDynamically 参数。runInContext 方法不支持在 SIGINT 上中断。

node:worker_threads 跳转到标题

parentPort: 不支持 emit 方法。不支持 removeAllListeners 方法。

markAsUntransferable: 此符号不受支持。

moveMessagePortToContext: 此符号不受支持。

receiveMessageOnPort: 此符号不受支持。

Worker: 不支持 getHeapSnapshot 方法。

node:zlib 跳转到标题

Options: 此类不受支持。

BrotliOptions: 此类不受支持。

BrotliCompress: 此类不受支持。

BrotliDecompress: 此类不受支持。

ZlibBase: 此类不受支持。

不支持的模块 (6/44) 跳转到标题

node:cluster 跳转到标题

所有导出都是非功能性占位符。

所有符号: 此符号是非功能性占位符。

node:domain 跳转到标题

所有导出都是非功能性占位符。这是一个已弃用的 Node 模块。

所有符号: 此符号是非功能性占位符。

node:repl 跳转到标题

不支持所有符号。

所有符号: 此符号不受支持。

node:sea 跳转到标题

不支持所有符号。

所有符号: 此符号不受支持。

node:trace_events 跳转到标题

所有导出都是非功能性占位符。

所有符号: 此符号是非功能性占位符。

node:wasi 跳转到标题

所有导出都是非功能性占位符。

所有符号: 此符号是非功能性占位符。

全局变量 跳转到标题

这是 Deno 支持的 Node 全局变量列表。这些全局变量仅在 npm 包作用域中可用。在您自己的代码中,您可以通过从相关的 node: 模块导入它们来使用它们。

全局名称 状态
AbortController
AbortSignal
Blob
Buffer
ByteLengthQueuingStrategy
__dirname ⚠️ 信息
__filename ⚠️ 信息
atob
BroadcastChannel
btoa
clearImmediate
clearInterval
clearTimeout
CompressionStream
console
CountQueuingStrategy
Crypto
CryptoKey
CustomEvent
CustomEvent
DecompressionStream
Event
EventTarget
exports
fetch
File
FormData
global
Headers
MessageChannel
MessageEvent
MessagePort
module
PerformanceEntry
PerformanceMark
PerformanceMeasure
PerformanceObserver
PerformanceObserverEntryList
PerformanceResourceTiming
performance
process
queueMicrotask
ReadableByteStreamController
ReadableStream
ReadableStreamBYOBReader
ReadableStreamBYOBRequest
ReadableStreamDefaultController
ReadableStreamDefaultReader
require
Response
Request
setImmediate
setInterval
setTimeout
structuredClone
structuredClone
SubtleCrypto
DOMException
TextDecoder
TextDecoderStream
TextEncoder
TextEncoderStream
TransformStream
TransformStreamDefaultController
URL
URLSearchParams
URLSearchParams
WebAssembly
WritableStream
WritableStreamDefaultController
WritableStreamDefaultWriter

您找到所需的信息了吗?

隐私政策