Skip to content

(node:3089) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues #15

Open
@olivertappin

Description

@olivertappin

When running SSH commands directly on my Digital Ocean instance, I can see the following in the GitHub Workflows output:

(node:3089) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

Looking at the following answer from Stack Overflow: https://stackoverflow.com/a/52257416/1421836

It looks like the following matches need changing:

➜  github-action-ssh git:(master) ack 'new Buffer\('
dist/index.js
8602:    needle = new Buffer(needle);
8613:  this._lookbehind = new Buffer(needle_len);
8637:    chunk = new Buffer(chunk, 'binary');

To one of the following:

new Buffer(number)            // Old
Buffer.alloc(number)          // New
new Buffer(string)            // Old
Buffer.from(string)           // New
new Buffer(string, encoding)  // Old
Buffer.from(string, encoding) // New
new Buffer(...arguments)      // Old
Buffer.from(...arguments)     // New

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions