Replace fs.truncate() with file descriptor to fs.ftruncate()
Recipe ID
org.openrewrite.node.migrate.fs.replace-fs-truncate-fdArtifact@openrewrite/recipes-nodejsReplace 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-fdIf the recipe isn’t available locally, install it with:
mod config recipes npm install @openrewrite/recipes-nodejs