Concurrent command line processes

1 minute read Published:

An easy way to combine tasks

I recently had a project in which I wanted to use both webpack and gulp without the hassle of opening multiple console windows. After a little bit of searching I found the package Concurrently which just feels good to use:

npm run dev

And you’re done.

To get it set up open up your package.json and put in some scripts you’d like to use like this:

{
  scripts: {
    serve: webpack-dev-server --inline --hot --watch --config=webpack.dev.config.js,
    dev: concurrent --kill-others \"gulp\" \"npm run serve\"
  }
}

You can chain as many of these processes as you want together to create a very powerful (yet modular feeling) script. Maybe you want to automatically run your tests, eslint –fix, gulp and any of the thousands of other JS tools at the same time? Now you can.

P.S. While I haven’t tested it I don’t see any reason why you can’t use this to run multiple non-js related tasks as well…

Go to here to find out more.

comments powered by Disqus