Type: Runtime (supports [--pending-deprecation][])
The Buffer() function and new Buffer() constructor are deprecated due to
API usability issues that can lead to accidental security issues.
As an alternative, use one of the following methods of constructing Buffer
objects:
- [
Buffer.alloc(size[, fill[, encoding]])][alloc]: Create aBufferwith initialized memory. - [
Buffer.allocUnsafe(size)][alloc_unsafe_size]: Create aBufferwith uninitialized memory. - [
Buffer.allocUnsafeSlow(size)][]: Create aBufferwith uninitialized memory. - [
Buffer.from(array)][]: Create aBufferwith a copy ofarray - [
Buffer.from(arrayBuffer[, byteOffset[, length]])][from_arraybuffer] - Create aBufferthat wraps the givenarrayBuffer. - [
Buffer.from(buffer)][]: Create aBufferthat copiesbuffer. - [
Buffer.from(string[, encoding])][from_string_encoding]: Create aBufferthat copiesstring.
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.
