npm多个命令串行(&&)并行(&)css
"test": "npm run lint:js && npm run lint:css && npm run lint:json && npm run lint:markdown && mocha tests/"
"test": "npm run lint:js & npm run lint:css & npm run lint:json & npm run lint:markdown & mocha tests/"
复制代码
npm run lint:js & npm run lint:css & npm run lint:json & npm run lint:markdown & mocha tests/ & wait
复制代码
加上 wait 的额外好处是,若是咱们在任何子命令中启动了长时间运行的进程,好比启用了 mocha 的 --watch 配置,可使用 ctrl + c 来结束进程,若是没加的话,你就没办法直接结束启动到后台的进程。npm