npm8中文文档
使用提供的参数在本地依赖项中运行 tap
的版本:
$ npm exec -- tap --bail test/foo.js
$ npx tap --bail test/foo.js
通过指定 --package
选项运行名称与包名称匹配的命令以外的命令:
$ npm exec --package=foo -- bar --bar-argument
# ~ or ~
$ npx --package=foo bar --bar-argument
在当前项目的上下文中运行任意 shell 脚本:
$ npm x -c 'eslint && say "hooray, lint passed"'
$ npx -c 'eslint && say "hooray, lint passed"'