diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index f10265b9ddd98a..ffe35b6d942b5c 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -695,6 +695,9 @@ Type: End-of-Life -Type: Documentation-only +Type: Runtime The [`SlowBuffer`][] class is deprecated. Please use [`Buffer.allocUnsafeSlow(size)`][] instead. diff --git a/lib/buffer.js b/lib/buffer.js index 6294eae2fb5093..9b116eabe69d36 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -88,6 +88,7 @@ const { kIsEncodingSymbol, defineLazyProperties, encodingsMap, + deprecate, } = require('internal/util'); const { isAnyArrayBuffer, @@ -1322,7 +1323,10 @@ function isAscii(input) { module.exports = { Buffer, - SlowBuffer, + SlowBuffer: deprecate( + SlowBuffer, + 'SlowBuffer() is deprecated. Please use Buffer.allowUnsafeSlow()', + 'DEP0030'), transcode, isUtf8, isAscii,