DEP0005:Buffer() 构造函数


\DEP0005: Buffer() constructor

版本历史
版本变更
v10.0.0

运行时弃用。

v6.12.0

已指定弃用代码。

v6.0.0

仅文档弃用。

类型:应用(仅限非 node_modules 代码)

\Type: Application (non-node_modules code only)

由于可能导致意外安全问题的 API 可用性问题,Buffer() 函数和 new Buffer() 构造函数已弃用。

\The Buffer() function and new Buffer() constructor are deprecated due to API usability issues that can lead to accidental security issues.

作为替代方案,使用以下方法之一构造 Buffer 对象:

\As an alternative, use one of the following methods of constructing Buffer objects:

如果没有 --pending-deprecation,运行时警告只会出现在不在 node_modules 中的代码中。这意味着在依赖中使用 Buffer() 不会有弃用警告。对于 --pending-deprecation,无论在何处使用 Buffer(),都会产生运行时警告。

\Without --pending-deprecation, runtime warnings occur only for code not in node_modules. This means there will not be deprecation warnings for Buffer() usage in dependencies. With --pending-deprecation, a runtime warning results no matter where the Buffer() usage occurs.

AltStyle によって変換されたページ (->オリジナル) /