← All recipes
Moderne licensed

Swap the hpagent dependency for https-proxy-agent

Recipe IDorg.openrewrite.node.migrate.hpagent.swap-hpagent-dependencyArtifact@openrewrite/recipes-nodejs

Replaces hpagent with https-proxy-agent in each package.json that declares it, in the same section and position, so the declaration order is left as it was. Where a source beneath the package.json still references hpagent — a usage the migration left in place, a mock, or a bundler configuration naming it — https-proxy-agent is added alongside and hpagent kept, since both are then needed. A package.json whose sources the migration didn't reach is left alone entirely, rather than gaining a dependency nothing uses. Lock files are not regenerated; run the package manager's install afterwards.

Single recipehttps-proxy-agenthpagentProprietary

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.hpagent.swap-hpagent-dependency

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

mod config recipes npm install @openrewrite/recipes-nodejs

Options

NameTypeDescription
versionStringThe version range to declare for https-proxy-agent. The default keeps hpagent's Node 14 floor; https-proxy-agent 9 and later require Node 20.
e.g. ^7.0.6