Replace fs-extra readJson with JSON.parse of readFile
ProprietaryReplaces fs-extra's readJson/readJSON and readJsonSync/readJSONSync with JSON.parse of readFile from node:fs/promises or readFileSync from node:fs. An awaited call becomes JSON.parse(await readFile(file, 'utf8')), any other promise use readFile(file, 'utf8').then(JSON.parse). An encoding passed as a string or {encoding} is kept. Calls passing throws, reviver, or other options, and callback-style calls, are left alone. Unlike fs-extra, JSON.parse does not strip a leading byte order mark.
org. openrewrite. node. migrate. fs-extra. replace-fs-extra-read-jsonmod run . --recipe= org. openrewrite. node. migrate. fs-extra. replace-fs-extra-read-jsonInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.