Skip to content

expressjs/codemod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7f39394 · Mar 24, 2025

History

40 Commits
Mar 24, 2025
Feb 9, 2025
Mar 13, 2025
Feb 9, 2025
Dec 7, 2024
Jan 13, 2025
Mar 6, 2025
Feb 21, 2025
Nov 3, 2024
Dec 12, 2024
Feb 9, 2025
Dec 7, 2024
Feb 21, 2025
Mar 14, 2025
Mar 11, 2025

Repository files navigation

@expressjs/codemod

NPM Version NPM Downloads OpenSSF Scorecard Badge

Express.js provides Codemod transforms to help you upgrade your express server when a feature is deprecated or removed.

Codemods are transformations that run on your codebase programmatically. This allows for a large amount of changes to be applied without having to manually go through every file.

Installation

You don't need to install this package, run the following command:

npx @expressjs/codemod # or pnpx, bunx, etc.

or install globally:

npm i -g @expressjs/codemod # or pnpm, bun, etc.

Usage

Use @expressjs/codemod -h to explore available command-line options.

Usage: @expressjs/codemod [codemod] [source] [options]

Options:
  -v, --version               Output the current version of @expressjs/codemod.
  -d, --dry                   Dry run (no changes are made to files)
  -p, --print                 Print transformed files to stdout
  --verbose                   Show more information about the transform process
  --silent                    Don't print anything to stdout
  -h, --help                  Display this help message.

Commands:
  upgrade [options] [source]  Upgrade your express server to the latest
                              version.

Available Codemods

All the available codemods to update your express server:

magic redirect (v5.0.0)

Transform the deprecated magic string "back"

pluralized methods (v5.0.0)

Transform the methods to their pluralized versions

v4 deprecated signatures (v5.0.0)

Transform the deprecated signatures in Express v4

req param (v5.0.0)

Change request.param() to dedicated methods

Contributing

The Express.js project welcomes all constructive contributions. Contributions take many forms, from code for bug fixes and enhancements, to additions and fixes to documentation, additional tests, triaging incoming pull requests and issues, and more!

See the Contributing Guide for more technical details on contributing.

License

MIT