天天看點

[NPM] Run npm scripts in parallel

In this lesson we will look at running several npm scripts in parallel. Sometimes you don’t need scripts to be run in series and switching them to run in parallel can increase performance since they are not blocking each other. At the end you need to add a wait command so they can be terminated with ^C

You can change '&&' to '&', so from series to parallel.

But it comes with a problem that, since mocha is running as second command, when we click 'ctrl + c', it actually doesn't change mocha in the background. 

To change all the parallel command in a single script, we can simply add a '&wait' in the end: