@expressjs/codemod

中文文档
0.0.5发布于 2025/06/02MIT近 30 天下载 9715

Codemods for updating express servers.

此软件包已被标记为弃用

This package has been deprecated and is no longer maintained. Please use the codemods available on codemod.com instead. To see all official codemods, visit https://app.codemod.com/registry?q=scope%3Aexpressjs.

原始使用文档
文档目录9 节
  1. Installation
  2. Usage
  3. Available Codemods
  4. magic redirect (v5.0.0)
  5. pluralized methods (v5.0.0)
  6. v4 deprecated signatures (v5.0.0)
  7. req param (v5.0.0)
  8. Contributing
  9. License

@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

版本与发布记录

@expressjs/codemod 共发布 5 个版本,首次发布于 2025/03/06;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.0.5latest2025/06/021.5 年前
0.0.42025/03/301.6 年前
0.0.32025/03/151.7 年前
0.0.22025/03/121.7 年前
0.0.12025/03/061.7 年前

关于 @expressjs/codemod 的常见问题

@expressjs/codemod 是什么?

Codemods for updating express servers.注意:该包已被作者标记为弃用——This package has been deprecated and is no longer maintained. Please use the codemods available on codemod.com instead. To see all official codemods, visit https://app.codemod.com/registry?q=scope%3Aexpressjs.

如何安装 @expressjs/codemod?

在项目目录运行 npm install @expressjs/codemod,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 express-codemod,可以用 npx express-codemod 直接运行。

@expressjs/codemod 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/expressjs__codemod 是否存在。

@expressjs/codemod 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@expressjs/codemod 可以商用吗?

@expressjs/codemod 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@expressjs/codemod 的下载量有多少?

根据 npm 官方下载统计,@expressjs/codemod 在 2026/10/14 – 2026/11/12 这 30 天内被下载 9,715 次,日均约 324 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@expressjs/codemod 还在维护吗?

最新版本 0.0.5 发布于 2025/06/02(1.5 年前);至今共发布 5 个版本,其中过去 12 个月发布了 0 个;首次发布于 2025/03/06。作者已将其标记为弃用,新项目建议寻找替代方案。