← All recipes
Moderne licensed

Replace deprecated SlowBuffer with Buffer.allocUnsafeSlow()

Recipe IDorg.openrewrite.node.migrate.buffer.replace-slow-bufferArtifact@openrewrite/recipes-nodejs

Replace deprecated new SlowBuffer(size) calls with Buffer.allocUnsafeSlow(size). SlowBuffer was used to create un-pooled Buffer instances, but has been removed in favor of the explicit Buffer.allocUnsafeSlow() method.

Single recipeDEP0030Proprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.node.migrate.buffer.replace-slow-buffer

If the recipe isn’t available locally, install it with:

mod config recipes npm install @openrewrite/recipes-nodejs