Concurrently 
NPM 
package 
explained
Tags:
  • npm
  • node.js
  • tooling
  • development

Introduction

Tired of opening multiple terminal tabs to run your dev server, API, and file watcher all at once? Yeah, me too. That's where concurrently comes in.

This tiny npm package lets you run multiple commands simultaneously from a single terminal. No more juggling between tabs or trying to remember which process is running where.

Basic Usage

Instead of this madness:

  • Tab 1: npm run dev
  • Tab 2: npm run api
  • Tab 3: npm run watch

Do this:

npx concurrently "npm run dev" "npm run api" "npm run watch"

Each command gets its own color in the output, so you can actually tell what's happening.

Real Example

Here's how I use it in my projects:

{
  "scripts": {
    "dev": "concurrently -n frontend,backend -c green,blue \"pnpm -F=frontend run dev\" \"pnpm -F=backend run dev\""
  }
}

Now npm run dev fires up everything I need for development.

Actually, this is the exact script I use to run the monorepo that powers this very blog. One command starts both the frontend and backend with nice green and blue colors so I can tell them apart.

Pro Tips

Give your processes names so you know what's what

concurrently --names "WEB,API,DB" "npm run dev" "npm run api" "npm run database"

Instead of seeing random colors, you'll see "WEB", "API", "DB" next to each output line.

Kill everything when one thing crashes

concurrently --kill-others "npm run dev" "npm run api"

If your API crashes, this will also kill your frontend. Saves you from running broken setups.

Stop everything if anything fails

concurrently --kill-others-on-fail --prefix "{name}" "npm run dev" "npm run api"

Similar to above, but only kills when something actually fails (not just exits normally).

Why I love it

One command to rule them all. Start your entire dev environment with npm start instead of remembering multiple commands. The output is clean since each process has its own color, so no more guessing which log belongs to what. It's easy to share with your team since members don't need to know 5 different commands to get started. Plus it works everywhere - CI, local dev, wherever you need it.

When not to use it

If you're just running one thing, don't bother. It's overkill for simple scripts.

Also, if your processes need to start in a specific order, you might want npm-run-all instead.

Conclusion

Concurrently is one of those tools that just makes life easier. Install it once, set up your scripts, and never think about terminal management again.

It's not revolutionary, but it's damn useful.

Affiliate Links

Fastmail

Game-changer for managing multiple email accounts in one place. New users get 10% off!

Code: 7aa3c189

Tangem wallet

Secure hardware wallet for crypto assets. Get 10% discount on your first purchase!

Code: ZQ6MMC

1Password

The best password manager I've used. Secure, easy to use, and saves countless hours.

Freedom24

Invest safely and get a free stock up to 700€ when you open an account!

Code: 2915527

Betterstack

The best way to view logs and errors. Get 10% off your first month!

Code: b-e5zf

ClickUp

The best way to manage your tasks and projects. Get 10% off your first month!

Hetzner

Solid cloud infra, great support, and a great price. Receive €20 in cloud credits.

Code: 3UskohfB0X36

Using these referral links helps support my work. I only recommend products I use and trust. Thank you for your support!