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:

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

By default:

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

This will run in series.

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

  1. "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. 洛谷——P1042 乒乓球

    https://www.luogu.org/problem/show?pid=1042 题目背景 国际乒联现在主席沙拉拉自从上任以来就立志于推行一系列改革,以推动乒乓球运动在全球的普及.其中11分制改 ...

  2. js遍历对象的属性和方法

    js遍历对象的属性和方法 一.总结 二.实例 练习1:具有默认值的构造函数 实例描述: 有时候在创建对象时候,我们希望某些属性具有默认值 案例思路: 在构造函数中判断参数值是否为undefined,如 ...

  3. C Tricks(十八)—— 整数绝对值的实现

    为正还是为负:(对 int 类型而言,第一位为符号位,其余为数值,则右移 31 位,再与 1 求与) 如果为正 ⇒ 返回原值 如果为负 ⇒ 对其二进制形式各位取反 + 1 int abs(int x) ...

  4. Excel数据比对-批量数据比对

    1.导出现场的Excel收费规则2.有专门的代码写的测试收费规则的工具(开发自己开发的)3.在这个工具上选择,导出的收费规则Excel,点击导出按钮(导出按钮里面有计算每一列的计费结果4.Excel里 ...

  5. Docker 部署Dotnet Core MVC项目

    原文:Docker 部署Dotnet Core MVC项目 1.dotnet core创建项目 dotnet new mvc -o myweb cd myweb 然后就是业务代码的编辑,增删改查乱七八 ...

  6. Traveler Nobita (zoj 3456 最小生成树)

    Traveler Nobita Time Limit: 2 Seconds      Memory Limit: 65536 KB One day, Nobita used a time machin ...

  7. web.config访问走代理的配置

    <system.net>    <defaultProxy>      <proxy bypassonlocal="False" usesystemd ...

  8. JQ的核心原理以及扩展等

    jQuery核心原理 定义原型扩展和工具包扩展的方法 JQ的API中文速查: http://jquery.cuishifeng.cn/ JQ的原理:http://www.cnblogs.com/Sca ...

  9. 使用wepy开发微信小程序商城第三篇:购物车(布局篇)

    使用wepy开发微信小程序商城 第三篇:购物车(布局篇) 前两篇如下: 使用wepy开发微信小程序商城第一篇:项目初始化 使用wepy开发微信小程序商城第二篇:路由配置和页面结构 基于上两篇内容,开始 ...

  10. 解决linux下cocos2dx不能播放声音

    cocos2dx2.2.1在linux下引用#include "SimpleAudioEngine.h".报错找不到该文件. 改动makefile文件,加入 SHAREDLIBS ...