npm-explore

浏览已安装的包

选择 CLI 版本:

概要

¥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"

    ¥Default: SHELL environment variable, or "bash" on Posix, or "cmd.exe" on Windows

  • 类型:字符串

    ¥Type: String

npm explore 命令运行的 shell。

¥The shell to run for the npm explore command.

也可以看看

¥See Also

npm 中文网 - 粤ICP备13048890号