Upgrade to Express 5

Proprietary

Upgrade an Express 4 application to Express 5. Rewrites the removed APIs app.del, res.sendfile, res.json(status, body)-style calls and res.redirect('back') (ReplaceRemovedExpressApis), moves string route paths to the path-to-regexp 8 syntax (MigrateRouteWildcards), then upgrades express and @types/express to 5.x in package.json. Express 5 requires Node.js 18 or later. Not done by this recipe: req.param(), the req.query parser default change, route paths built from variables or regular expressions, and raising engines.node; read the Express 5 migration guide for them.

org.openrewrite.nodejs.migrate.express.UpgradeToExpress5
mod run . --recipe=org.openrewrite.nodejs.migrate.express.UpgradeToExpress5

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.