npm-explore

浏览已安装的包

选择命令行版本:

概要

🌐 Synopsis

npm explore <pkg> [ -- <command>]

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

🌐 Note: This command is unaware of workspaces.

描述

🌐 Description

在指定的已安装包的目录中生成一个子 shell。

🌐 Spawn a subshell in the directory of the installed package specified.

如果指定了命令,则它在子 shell 中运行,然后立即终止。

🌐 If a command is specified, then it is run in the subshell, which then immediately terminates.

node_modules 文件夹中的 git 子模块情况下,这尤其方便:

🌐 This is particularly handy in the case of git submodules in the node_modules folder:

npm explore some-dependency -- git pull origin master

请注意,该软件包之后不会自动重建,因此如果你进行任何更改,请务必使用 npm rebuild <pkg>

🌐 Note that the package is not automatically rebuilt afterwards, so be sure to use npm rebuild <pkg> if you make any changes.

配置

🌐 Configuration

shell

  • 默认:SHELL 环境变量,Posix 系统上为“bash”,Windows 上为“cmd.exe”
  • 类型:字符串

用于运行 npm explore 命令的 shell。

🌐 The shell to run for the npm explore command.

也可以看看

🌐 See Also