← All recipes
Moderne licensed

Replace fs.truncate() with file descriptor to fs.ftruncate()

Recipe IDorg.openrewrite.node.migrate.fs.replace-fs-truncate-fdArtifact@openrewrite/recipes-nodejs

Replace deprecated fs.truncate(fd, ...) and fs.truncateSync(fd, ...) calls with fs.ftruncate(fd, ...) and fs.ftruncateSync(fd, ...) when the first argument is a file descriptor (number).

Single recipeDEP0081Proprietary

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.fs.replace-fs-truncate-fd

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

mod config recipes npm install @openrewrite/recipes-nodejs