tagomoris / presto-client-node

Distributed query engine Presto client library for node.js
MIT License
126 stars 57 forks source link

chore: update Buffer.from usage for compatibility #91

Closed aromalsanthosh closed 4 months ago

aromalsanthosh commented 5 months ago

The code was updated to resolve a deprecation issue with the Buffer constructor in Node.js. The error encountered was:

TypeError: Cannot read properties of null (reading '0')
    at isInsideNodeModules (node:internal/util:508:17)
    at showFlaggedDeprecation (node:buffer:178:8)
    at new Buffer (node:buffer:266:3)
    ...

This error occurs due to the use of the deprecated new Buffer() constructor, which is no longer recommended. Instead, the Buffer.from() method should be used for creating buffers from strings.

Explanation:

By making this change, the code is updated to be compatible with the latest Node.js standards, eliminating the deprecation warning and potential future issues related to the Buffer constructor.

tagomoris commented 4 months ago

@aromalsanthosh Thank you!