GithubHelp home page GithubHelp logo

freshheads / run-concurrently Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gnoesiboe/run-concurrently

0.0 1.0 0.0 865 KB

Command line tool to use 'concurrently' with a JSON configuration, to make it more readable and easier to manage.

JavaScript 100.00%

run-concurrently's Introduction

@gnoesiboe/run-concurrently

Node cli task that uses concurrently combined with a JSON configuration in package.json or seperate file, to make concurrent tasks better readable and easier to manage. It for instance can be used to build a project in one command, as it consists of seperate individual applications. Within our organisation we plan on using it for building several seperate webpack applications.

alt text;

Installation

npm install --save-dev @gnoesiboe/run-concurrently

Usage

  1. Add your task configuration to your application's package.json or seperate json file.
  2. Use the cli command to execute the tasks concurrently
  3. Setup shortcuts in the root of your application for easier execution (for instance scripts in package.json or make)

Configuration

Can be placed in package.json, located in the location that this task is run from:

Format:

{
    ...,
    "concurrentTasks": {
        "<task_name>": {
            "subTasks": [
                {
                    "workingDirectory": "<directory_to_execute_code_in>",
                    "command": "<command_to_execute_in_working_directory>",
                    "name": "<prefix_that_is_used_to_distinguish_seperate_tasks_output>"
                },
                ...
            ]
        }
    }
}

Example, added to package.json:

{
    ...,
    "concurrentTasks": {
        "build": {
            "subTasks": [
                {
                    "workingDirectory": "./assets/a",
                    "command": "npm run build",
                    "name": "website"
                },
                {
                    "workingDirectory": "./assets/b",
                    "command": "npm run build",
                    "name": "admin"
                },
                {
                    "workingDirectory": "./assets/c",
                    "command": "npm run build",
                    "name": "frontend"
                }
            ],
            "options": {
                "prefixLength": 20
            }
        },
        "build:watch": {
            "subTasks": [...]
        }
    }
}

You can also place the configuration outside the package.json and into a seperate file. For this task to find it, you have to use the --config option to supply the server path to it. See below for more information.

CLI command usage

Arguments

name description type required default value
task The task to execute from the configuration string false 'build'

Options

name description type required default value
--config or -c Path to an alternate configuration file that you want to use string false fallback on package.json in current working directory
--help or -h Prints information about how to use this cli command na. false na.
--verbose or -v If flagged with verbose, extra debug output is displayed na. false na.

Example

run-concurrently build --config=/some/dir/runConcurrentlyConfig.json --verbose

Developmemt

Install dependencies:

npm install

Running tests

Run tests by executing:

npm run test

Or in watch mode:

npm run test:watch

run-concurrently's People

Contributors

dependabot[bot] avatar martinbroos avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.