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. Linux经常使用命令(七) - cp

    cp命令用来拷贝文件或者文件夹.是Linux系统中最经常使用的命令之中的一个.普通情况下.shell会设置一个别名.在命令行下拷贝文件时,假设目标文件已经存在.就会询问是否覆盖.无论你是否使用-i參数 ...

  2. 106.TCP传文件

    客户端 #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include < ...

  3. 最小二乘法,python3实现

    https://www.cnblogs.com/BlogOfMr-Leo/p/8627311.html                      [用的是库函数] https://blog.csdn. ...

  4. js原生代码实现鼠标拖拽(超简单)

    首先先来看这一张图 在这种图中,盒子的大小为512px,并且margin-left:-250px margin-top:140px;并通过一些样式让其在中部显示 这些样式都不是重要的,这里加个marg ...

  5. Vue 使用use、prototype自定义自己的全局组件

    使用Vue.use()写一个自己的全局组件. 目录如下: 然后在Loading.vue里面定义自己的组件模板 <template> <div v-if="loadFlag& ...

  6. ThinkPHP5.0---删除数据

    删除特定记录 public function delete() { // 获取要删除的对象:关键字为16 $Teacher = Teacher::); // 删除对象 $Teacher->del ...

  7. ASP.NET Core 2.2 十九. 你扔过来个json,我怎么接

    原文:ASP.NET Core 2.2 十九. 你扔过来个json,我怎么接 前文说道了Action的激活,这里有个关键的操作就是Action参数的映射与模型绑定,这里即涉及到简单的string.in ...

  8. 好记性不如烂笔头——double

    两个数据转换成double型做差,会出现误差,转换成Decimal就OK了.

  9. (转)Oracle命令

    转自:http://www.cnblogs.com/NaughtyBoy/p/3181052.html Oracle登录命令 1.运行SQLPLUS工具 C:\Users\wd-pc>sqlpl ...

  10. [React Intl] Get locale value from intl injector

    Get 'injectIntl' from  'react-intl', it is a high order componet. We need to wrap our component into ...