npm-edit

编辑已安装的包

选择命令行版本:

概要

🌐 Synopsis

npm edit <pkg>[/<subpkg>...]

注意:此命令不支持工作区。

🌐 Note: This command is unaware of workspaces.

描述

🌐 Description

在当前项目中选择一个依赖,并在默认编辑器中打开包文件夹(或你已配置为 npm editor 配置的编辑器 —— 参见 npm-config)。

🌐 Selects a dependency in the current project and opens the package folder in the default editor (or whatever you've configured as the npm editor config -- see npm-config.)

在它被编辑之后,包被重新构建,以便获取编译包中的任何更改。

🌐 After it has been edited, the package is rebuilt so as to pick up any changes in compiled packages.

例如,你可以使用 npm install connect 将 connect 安装到你的包中,然后使用 npm edit connect 对你本地安装的副本进行一些修改。

🌐 For instance, you can do npm install connect to install connect into your package, and then npm edit connect to make a few changes to your locally installed copy.

配置

🌐 Configuration

editor

  • 默认:EDITOR 或 VISUAL 环境变量,或在 Windows 上为 '%SYSTEMROOT%\notepad.exe',在 Unix 系统上为 'vi'
  • 类型:字符串

运行 npm editnpm config edit 的命令。

🌐 The command to run for npm edit and npm config edit.

也可以看看

🌐 See Also