frame-stream icon indicating copy to clipboard operation
frame-stream copied to clipboard

Use of deprecated `util._extend` API

Open bxt opened this issue 10 months ago • 1 comments

After starting my project with node version v22.14.0 (current LTS), I got a deprecation warning which I could trace back to the frame-stream package using the --trace-deprecation flag:

(node:58294) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
    at new exports.Decoder (.../node_modules/frame-stream/lib/index.js:12:20)
    at module.exports (.../node_modules/frame-stream/lib/index.js:7:10)
...

I can see the API is used in the code here in the constructor of Decoder:

https://github.com/davedoesdev/frame-stream/blob/f688aee92d2fb10f5f7959740296887c2a98aecb/lib/index.js#L12

The docs from Node.js about this deprecation seem to be here: https://nodejs.org/api/deprecations.html#DEP0060

It seems this was deprecated for a long time, and just version 22 of Node starts printing this warning.

It's just a warning for now, but it would be cool if this would not show up in the logs.

It seems to me it would be easy to replace it with Object.assign() which has been there since node 4.0.0 and this project lists >=18 in the node engines field.

bxt avatar Mar 03 '25 23:03 bxt

I created a PR to fix it here: https://github.com/davedoesdev/frame-stream/pull/24

bxt avatar Mar 04 '25 16:03 bxt