A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/open-cli-tools/concurrently below:

open-cli-tools/concurrently: Run commands concurrently. Like `npm run watch-js & npm run watch-less` but better.

Run multiple commands concurrently. Like npm run watch-js & npm run watch-less but better.

Table of Contents

I like task automation with npm but the usual way to run multiple commands concurrently is npm run watch-js & npm run watch-css. That's fine but it's hard to keep on track of different outputs. Also if one process fails, others still keep running and you won't even notice the difference.

Another option would be to just run all commands in separate terminals. I got tired of opening terminals and made concurrently.

Features:

concurrently can be installed in the global scope (if you'd like to have it available and use it on the whole system) or locally for a specific package (for example if you'd like to use it in the scripts section of your package):

npm Yarn pnpm Bun Global npm i -g concurrently yarn global add concurrently pnpm add -g concurrently bun add -g concurrently Local* npm i -D concurrently yarn add -D concurrently pnpm add -D concurrently bun add -d concurrently

* It's recommended to add concurrently to devDependencies as it's usually used for developing purposes. Please adjust the command if this doesn't apply in your case.

Note The concurrently command is also available under the shorthand alias conc.

The tool is written in Node.js, but you can use it to run any commands.

Remember to surround separate commands with quotes:

concurrently 'command1 arg' 'command2 arg'

Otherwise concurrently would try to run 4 separate commands: command1, arg, command2, arg.

In package.json, escape quotes:

"start": "concurrently 'command1 arg' 'command2 arg'"

You can always check concurrently's flag list by running concurrently --help. For the version, run concurrently --version.

Check out documentation and other usage examples in the docs directory.

concurrently can be used programmatically by using the API documented below:

concurrently(commands[, options])

Returns: an object in the shape { result, commands }.

Example:

const concurrently = require('concurrently');
const { result } = concurrently(
  [
    'npm:watch-*',
    { command: 'nodemon', name: 'server' },
    { command: 'deploy', name: 'deploy', env: { PUBLIC_KEY: '...' } },
    {
      command: 'watch',
      name: 'watch',
      cwd: path.resolve(__dirname, 'scripts/watchers'),
    },
  ],
  {
    prefix: 'name',
    killOthers: ['failure', 'success'],
    restartTries: 3,
    cwd: path.resolve(__dirname, 'scripts'),
  },
);
result.then(success, failure);

An object that contains all information about a spawned command, and ways to interact with it.
It has the following properties:

An object that represents a message that was received from/sent to the underlying command process.
It has the following properties:

An object with information about a command's closing event.
It contains the following properties:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4