Replace deprecated Buffer() constructor with Buffer.alloc() and Buffer.from()
ProprietaryReplace deprecated new Buffer(...) and Buffer(...) calls with Buffer.alloc(size) for a numeric size and Buffer.from(...) for strings, arrays, buffers and array buffers. Calls are left unchanged when the argument's type doesn't show which one applies, such as an untyped value, any, or string | number.
org. openrewrite. node. migrate. buffer. replace-deprecated-constructormod run . --recipe= org. openrewrite. node. migrate. buffer. replace-deprecated-constructorInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.