resource


resource 是一个表示已初始化的实际异步资源的对象。访问该对象的 API 可能由资源的创建者指定。由 Node.js 本身创建的资源是内部资源,可能随时发生变化。因此,这些资源没有指定的 API。

在某些情况下,出于性能原因会重用资源对象,因此将其用作 WeakMap 的键或向其添加属性是不安全的。

【In some cases the resource object is reused for performance reasons, it is thus not safe to use it as a key in a WeakMap or add properties to it.】