百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
N

npm-run-all

> 数据库
开源

一个用于并行或串行运行多个 npm-scripts 的 CLI 工具。

5.8K stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一个用于并行或串行运行多个 npm-scripts 的 CLI 工具。

index npm-run-all run-s [run-p] [Node API]

npm-run-all

一个用于并行或串行运行多个 npm-scripts 的 CLI 工具。

⤴️ 动机

  • 简化。 官方的 npm run-script 命令无法运行多个脚本,因此如果要运行多个脚本,就会显得有些冗余。让我们通过类似 glob 的模式来缩短它。
    之前:npm run clean && npm run build:css && npm run build:js && npm run build:html
    之后:npm-run-all clean build:*
  • 跨平台。 我们有时会使用 & 来并行运行多个命令,但 cmd.exe(npm run-script 默认使用它)不支持 &。Node.js 的用户中有一半在 Windows 上使用它,因此使用 & 可能会阻碍贡献。npm-run-all --parallel 在 Windows 上也能很好地运行。

安装

bash
$ npm install npm-run-all --save-dev
# or
$ yarn add npm-run-all --dev
  • 它需要 Node@>=4。

用法

CLI 命令

这个 npm-run-all 包提供了 3 个 CLI 命令。

  • npm-run-all
  • run-s
  • [run-p]

主命令是 npm-run-all。 我们可以使用 npm-run-all 命令制定复杂的计划。

run-s 和 [run-p] 都是简写命令。 run-s 用于顺序执行,[run-p] 用于并行执行。 我们可以使用这些命令制定简单的计划。

Yarn 兼容性

如果脚本是通过 Yarn 调用的,npm-run-all 会正确地使用 Yarn 来执行计划中的子脚本。

Node API

这个 npm-run-all 包提供了 Node API。

  • [Node API]

更新日志

  • https://github.com/mysticatea/npm-run-all/releases

贡献

欢迎♡

Bug 报告或功能请求

请使用 GitHub Issues。

修正文档

请使用 GitHub Pull Requests。

我不熟悉英语,因此特别感谢您对文档的修正。

实现

请使用 GitHub Pull Requests。

有一些 npm-scripts 可以帮助开发。

  • npm test - 运行测试并收集覆盖率。
  • npm run clean - 删除临时文件。
  • npm run lint - 运行 ESLint。
  • npm run watch - 在每次文件更改时运行测试(不收集覆盖率)。

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScriptclicli-commandcli-commandsjavascript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类数据库
定价开源

> 相关工具

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库