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. Node.js笔记(九)Nodejs与shell

    众所周知.Nodejs是单进程异步执行的.但不光是单进程,Nodejs也提供了多进程方面的支持 其创始人应该还是比較重视这一块的,最有力的证据就是child_process是Nodejs核心模块之中的 ...

  2. C++ 学习路线推荐

        相信有非常大一部分学计算机的童鞋都是靠自学,即使本身是计算机专业的同学,也会认为只通过课堂上的学习是远远不够的,并且在上课时所用到的教材也不够好.然而自学的时候有个非常大的问题就是找不到合适的 ...

  3. input输入框获得、失去焦点添加事件

    onBlur:当输入框失去焦点后 onFocus:当输入框获得焦点后 这两个JavaScript事件是写在html标签中的例如: <input type="text" onB ...

  4. TC Hangs when using quick search extended on win10 (1703)

    https://ghisler.ch/board/viewtopic.php?t=47682 I recently updated windows 10 to the latest released ...

  5. Android多线程研究(6)——多线程之间数据隔离

    在上一篇<Android多线程研究(5)--线程之间共享数据>中对线程之间的数据共享进行了学习和研究,这一篇我们来看看怎样解决多个线程之间的数据隔离问题,什么是数据隔离呢?比方说我们如今开 ...

  6. Cocos2d-x学习笔记(一)HelloWorld

    原创文章,转载请注明出处:http://blog.csdn.net/sfh366958228/article/details/38656755 前言 正式来公司实习已有一月,前一月主要是看了<C ...

  7. Windows下编译OpenSSL(使用VS2013)

    简述 OpenSSL是一个开源的第三方库,它实现了SSL(Secure SocketLayer)和TLS(Transport Layer Security)协议,被广泛企业应用所采用.对于一般的开发人 ...

  8. Ubuntu 14.04安装teamviewer 远程桌面

    teamviewer 真是一款非常强大的远程登录软件,可以跨Windows和Ubuntu远程登录,但是在64bit的Ubuntu下安装时,按照官方安装方法总是会遇到问题,下面说一下如何安装: 安装i3 ...

  9. python 的spyder用法

    ctrl+tab可以进行跳转 https://blog.csdn.net/luckygirl0809/article/details/79929491

  10. Scala入门到精通——第十九节 隐式转换与隐式參数(二)

    作者:摇摆少年梦 配套视频地址:http://www.xuetuwuyou.com/course/12 本节主要内容 隐式參数中的隐式转换 函数中隐式參数使用概要 隐式转换问题梳理 1. 隐式參数中的 ...