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.

"test": "npm run eslint & mocha spec/ --require babel-register --watch & npm run stylelint",

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:

"test": "npm run eslint & mocha spec/ --require babel-register --watch & npm run stylelint & wait",

[NPM] Run npm scripts in parallel的更多相关文章

  1. [NPM] Run npm scripts when files change with onchange

    In this lesson we will look at how we can setup our npm scripts to execute when the file system has ...

  2. [NPM] Run npm scripts in series

    After creating several npm script it becomes useful to run multiple scripts back-to-back in series. ...

  3. [NPM] Run npm scripts with git hooks

    In this lesson we will look about how we can integrate with git hooks to help enforce a certain leve ...

  4. [Whole Web] [Node.js] Using npm run to launch local scripts

    npm run allows you to configure scripts inside of your package.json file which can access locally in ...

  5. [NPM] Make npm scripts cross-environment friendly

    Unfortunately not all shell commands work across various environments. Two main techniques to suppor ...

  6. 在package.json中配置Script执行npm run tslint报错问题

    今天在学习tslint的时候,按照git clone下angular2-webpack-starter的代码执行npm run lint时,虽然代码进行了检测,但检测完成后npm始终报错, //pac ...

  7. [Node.js] Configuring npm package.json scripts

    With a node package manager's (npm) package.json script property, you can preconfigure common tasks ...

  8. vue-cli 官方模板webpack-simple的npm run dev 与npm run bulid的一些问题

    npm run dev命令后并不会在dist目录下生成build.js文件,开发环境下build.js是在运行内存中的. 在package.json的scripts属性的dev后面加上--port 8 ...

  9. Electron 桌面应用打包(npm run build)简述(windows + mac)

    最近一段时间在用electron+vue做内部项目的一键构建发布系统的桌面应用,现就其中打包流程写个备注,以示记录. Windows环境打包:1.首先贴一下package.json. { " ...

随机推荐

  1. mysql 多实例案例实战

    其实Mysql多实例就是在一个 mysql 服务上面启动三个实例,相当于三个分离开来的数据库,至于为什么要做这个,你也可以选择分别安装三个MySQL,只是过于麻烦,多实例中只需要一个配置档my.cnf ...

  2. cx_Oracle

    cx_Oracle 安装 pip install cx_Oracle 只是我没用那个安装成功过.我找了rpm 包. http://nchc.dl.sourceforge.net/project/cx- ...

  3. Node组装启动过程

    elasticsearch的启动过程是根据配置和环境组装需要的模块并启动的过程.这一过程就是通过guice注入各个功能模块并启动这些模块,从而得到一个功能完整的node.正如之前所说elasticse ...

  4. java 文件读写--转载

    读文件 http://www.baeldung.com/java-read-file Java – Read from File 1. Overview In this tutorial we’ll ...

  5. python基础--数值类型和序列类型

    Python中数值类型:int(整数),float(浮点数),True/False(布尔值,首字母必须大写) int:1    #任意整数 float:2.3   #小数 python赋值: a = ...

  6. SoapUI、Jmeter、Postman三种接口测试工具的比较分析——灰蓝

    前段时间忙于接口测试,也看了几款接口测试工具,简单从几个角度做了个比较,拿出来与诸位分享一下吧.各位如果要转载,请一定注明来源,最好在评论中告知博主一声,感谢.本报告从多个方面对接口测试的三款常用工具 ...

  7. apache+nginx 实现动静分离

    apache+nginx 实现动静分离 http://blog.csdn.net/xysoul/article/details/50347971

  8. 在设置了android:parentActivityName后,点击子Activity返回键,父Activity总会调用OnDestroy()的解决方式

    近期查了非常久这个事情.分享给大家, 原理非常easy,一个Activity在manifet里声明了android:parentActivityName:这时候通过Activity左上角的返回butt ...

  9. 多校连萌15-8-12#A

    #include <cstdio> #include <iostream> #include <algorithm> #include <queue> ...

  10. 浅谈Normalize.css

    浅谈Normalize.css 一.总结 1.Normalize.css:它在默认的HTML元素样式上提供了跨浏览器的高度一致性,花了几百个小时来努力研究不同浏览器的默认样式的差异. 2.优于rese ...