Running multiple scripts in series or in parallel can become very verbose. Using a tool such as npm-run-all can help reduce the amount of overhead you have to type in order to get the same behavior.

Install:

npm i -D npm-run-all
  "scripts": {
"start": "node index.js",
"test": "npm-run-all eslint stylelint mocha",
"eslint": "eslint --cache --fix ./",
"stylelint": "stylelint '**/*.scss' --syntax scss",
"mocha": "mocha spec/ --require babel-register --watch"
},

By default:

"test": "npm-run-all eslint stylelint mocha",

This will run in series.

TO make it run in parellel, we can add flag:

"test": "npm-run-all --parallel eslint mocha stylelint",

Here notice that we put 'mocha' on the second, but we still able to stop it by 'ctrl + c'

[NPM] Use a shorthand syntax for running multiple npm scripts with npm-run-all的更多相关文章

  1. mac下npm/node的安装和卸载、升级;node、npm升级后最后删掉node_modules重新安装

    mac还是使用brew install简单一些:最好使用一种安装方式,不要多种方式互用: 更新npm到最新版本npm install -g npm更新npm到指定版本 npm -g install n ...

  2. npm学习(一)之安装、更新以及管理npm版本

    安装npm 安装前须知: npm是在Node中编写的,因此需要安装Node.js才能使用npm.可以通过Node.js网站安装npm,或者安装节点版本管理器NVM. 如果只是想开始探索npm,使用No ...

  3. tunneling socket could not be established, cause=connect ECONNREFUSED 127.0.0.1:56281 npm ERR! network This is most likely not a problem with npm itself npm ERR! network and is related to network

    tunneling socket could not be established, cause=connect ECONNREFUSED 127.0.0.1:56281npm ERR! networ ...

  4. [Tool] Open Multiple Terminal Tabs on npm Start with ttab and npm-run-all

    Often times when developing web applications, you need to open multiple tabs to run different script ...

  5. [Docker] Running Multiple Containers for an Angular, Node project

    The code is from Plusight course, github link is here. In this post, we will give a overview about h ...

  6. Running multiple instances of Xamarin Studio on a Mac

    I love developing software on my MacBook Air! I got the latest version with the maximum possible spe ...

  7. Running multiple commands in one line in shell

      You are using | (pipe) to direct the output of a command into another command. What you are lookin ...

  8. npm全局安装和本地安装和本地开发安装(npm install --g/--save/--save-dev)

    详细说明参考:http://www.cnblogs.com/PeunZhang/p/5629329.html 我个人理解: 1.全局安装(npm install -g)是为了用命令行,比如在windo ...

  9. node 中 npm报错 Error: ENOENT, stat 'C:\Users\Administrator\AppData\Roaming\npm'

    今天在看node书本时,安装express,看看里面的包.没想到出现这样一种情况. 报错了.后来思考了一下,可能是修改了node的默认安装路径.于是准备在出错的路径下建一个npm文件夹. 注意,有个时 ...

随机推荐

  1. java 钩子方法

    Runtime.getRuntime().addShutdownHook(shutdownHook);    这个方法的含义说明:        这个方法的意思就是在jvm中增加一个关闭的钩子,当jv ...

  2. Android ProGuard代码混淆技术详解

    前言     受<APP研发录>启发,里面讲到一名Android程序员,在工作一段时间后,会感觉到迷茫,想进阶的话接下去是看Android系统源码呢,还是每天继续做应用,毕竟每天都是画UI ...

  3. ES5比较Jquery中的each与map 方法?

    1.each es5: var arr = [1, 5, 7, 8, 9];var arr1 = []; arr.forEach(function (v, i) { arr1.push(v * 4) ...

  4. Java Web学习总结(13)——JSP入门

    一.什么是JSP? JSP全称是Java Server Pages,它和servle技术一样,都是SUN公司定义的一种用于开发动态web资源的技术. JSP这门技术的最大的特点在于,写jsp就像在写h ...

  5. [D3] Debug D3 v4 with Dev Tools

    Since D3 outputs standard markup, you can use familiar dev tools and inspectors to debug your visual ...

  6. JS学习笔记 - 透明度运动框

    该练习的笔记如下: 1.  var cur=0;  //先声明一个变量. 2.  parseInt会舍掉小数,而opacity值恰恰是小数,所以对于opacity,必须用parseFloat. cur ...

  7. WPF 支持分组互斥的 RadioButton 式单选菜单

    扩展 MenuItem 为同组互斥的 RadioMenuItem,并且将对勾符号修改为圆点. http://stackoverflow.com/a/35692688/5972372 这个问题下还有其他 ...

  8. js进阶 12-16 jquery如何实现通过点击按钮和按下组合键两种方式提交留言

    js进阶 12-16 jquery如何实现通过点击按钮和按下组合键两种方式提交留言 一.总结 一句话总结:实现按下组合键提交留言是通过给input加keydown事件,判断按键的键码来实现的. 1.如 ...

  9. Let's do our own full blown HTTP server with Netty--转载

    原文地址:http://adolgarev.blogspot.com/2013/12/lets-do-our-own-full-blown-http-server.html Sometimes ser ...

  10. 每日技术总结:filter(),Bscroll

    前言: 这是一个vue的电商项目,使用express后端提供数据. 1.filter()函数. 事情是这样的.我从数据库拿到了所有分类数据. 分类有三个等级.父类,子类,孙类这样.但它们都在同一张表里 ...