← All recipes
Moderne licensed

Remove unnecessary util.promisify() on Promise-returning functions

Recipe IDorg.openrewrite.node.migrate.util.remove-promisify-on-promiseArtifact@openrewrite/recipes-nodejs

Removes util.promisify() calls on functions that already return a Promise. Since Node.js v17.0.0, calling promisify on a function that returns a Promise emits a runtime deprecation warning (DEP0174).

Single recipeDEP0174Proprietary

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.util.remove-promisify-on-promise

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

mod config recipes npm install @openrewrite/recipes-nodejs