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