← All recipes
Moderne licensed

Replace deprecated fs.Stats constructor with object literal

Recipe IDorg.openrewrite.node.migrate.fs.replace-stats-constructorArtifact@openrewrite/recipes-nodejs

Replace deprecated new fs.Stats() constructor calls with an object literal containing Stats properties initialized to undefined.

Single recipeDEP0180Proprietary

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-stats-constructor

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

mod config recipes npm install @openrewrite/recipes-nodejs