[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-10360":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":16,"starSnapshotCount":16,"syncStatus":19,"lastSyncTime":33,"discoverSource":34},10360,"concurrently","open-cli-tools\u002Fconcurrently","open-cli-tools","Run commands concurrently. Like `npm run watch-js & npm run watch-less` but better.","https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fconcurrently",null,"TypeScript",7779,265,28,51,0,3,21,2,66.87,"MIT License",false,"main",[25,26,5,27,28,29],"cli","command-line","parallel","process","spawn","2026-06-11 04:03:48","# concurrently\n\n[![Latest Release](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fv\u002Frelease\u002Fopen-cli-tools\u002Fconcurrently?label=Release)](https:\u002F\u002Fgithub.com\u002Fopen-cli-tools\u002Fconcurrently\u002Freleases)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Fopen-cli-tools\u002Fconcurrently?label=License)](https:\u002F\u002Fgithub.com\u002Fopen-cli-tools\u002Fconcurrently\u002Fblob\u002Fmain\u002FLICENSE)\n[![Weekly Downloads on NPM](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fdw\u002Fconcurrently?label=Downloads&logo=npm)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fconcurrently)\n[![CI Status](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Fopen-cli-tools\u002Fconcurrently\u002Fci.yml?label=CI&logo=github)](https:\u002F\u002Fgithub.com\u002Fopen-cli-tools\u002Fconcurrently\u002Factions\u002Fworkflows\u002Fci.yml)\n[![Coverage Status](https:\u002F\u002Fimg.shields.io\u002Fcoveralls\u002Fgithub\u002Fopen-cli-tools\u002Fconcurrently\u002Fmain?label=Coverage&logo=coveralls)](https:\u002F\u002Fcoveralls.io\u002Fgithub\u002Fopen-cli-tools\u002Fconcurrently?branch=main)\n\nRun multiple commands concurrently.\nLike `npm run watch-js & npm run watch-less` but better.\n\n![Demo](docs\u002Fdemo.gif)\n\n**Table of Contents**\n\n- [concurrently](#concurrently)\n  - [Why](#why)\n  - [Installation](#installation)\n  - [Usage](#usage)\n  - [API](#api)\n    - [`concurrently(commands[, options])`](#concurrentlycommands-options)\n    - [`Command`](#command)\n    - [`CloseEvent`](#closeevent)\n  - [FAQ](#faq)\n\n## Why\n\nI like [task automation with npm](https:\u002F\u002Fweb.archive.org\u002Fweb\u002F20220531064025\u002Fhttps:\u002F\u002Fgithub.com\u002Fsubstack\u002Fblog\u002Fblob\u002Fmaster\u002Fnpm_run.markdown)\nbut the usual way to run multiple commands concurrently is\n`npm run watch-js & npm run watch-css`. That's fine but it's hard to keep\non track of different outputs. Also if one process fails, others still keep running\nand you won't even notice the difference.\n\nAnother option would be to just run all commands in separate terminals. I got\ntired of opening terminals and made **concurrently**.\n\n**Features:**\n\n- Cross platform (including Windows)\n- Output is easy to follow with prefixes\n- With `--kill-others` switch, all commands are killed if one dies\n\n## Installation\n\n**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):\n\n|             | npm                     | Yarn                           | pnpm                       | Bun                       |\n| ----------- | ----------------------- | ------------------------------ | -------------------------- | ------------------------- |\n| **Global**  | `npm i -g concurrently` | `yarn global add concurrently` | `pnpm add -g concurrently` | `bun add -g concurrently` |\n| **Local**\\* | `npm i -D concurrently` | `yarn add -D concurrently`     | `pnpm add -D concurrently` | `bun add -d concurrently` |\n\n\u003Csub>\\* 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.\u003C\u002Fsub>\n\n## Usage\n\n> **Note**\n> The `concurrently` command is also available under the shorthand alias `conc`.\n\nThe tool is written in Node.js, but you can use it to run **any** commands.\n\nRemember to surround separate commands with quotes:\n\n```bash\nconcurrently 'command1 arg' 'command2 arg'\n```\n\nOtherwise **concurrently** would try to run 4 separate commands:\n`command1`, `arg`, `command2`, `arg`.\n\n> [!IMPORTANT]\n> Windows only supports double quotes:\n>\n> ```bash\n> concurrently \"command1 arg\" \"command2 arg\"\n> ```\n>\n> Remember to escape the double quotes in your package.json when using Windows:\n>\n> ```json\n> \"start\": \"concurrently \\\"command1 arg\\\" \\\"command2 arg\\\"\"\n> ```\n\nYou can always check concurrently's flag list by running `concurrently --help`.\nFor the version, run `concurrently --version`.\n\nCheck out documentation and other usage examples in the [`docs` directory](.\u002Fdocs\u002FREADME.md).\n\n## API\n\n**concurrently** can be used programmatically by using the API documented below:\n\n### `concurrently(commands[, options])`\n\n- `commands`: an array of either strings (containing the commands to run) or objects\n  with the shape `{ command, name, prefixColor, env, cwd, ipc }`.\n\n- `options` (optional): an object containing any of the below:\n  - `cwd`: the working directory to be used by all commands. Can be overridden per command.\n    Default: `process.cwd()`.\n  - `defaultInputTarget`: the default input target when reading from `inputStream`.\n    Default: `0`.\n  - `handleInput`: when `true`, reads input from `process.stdin`.\n  - `inputStream`: a [`Readable` stream](https:\u002F\u002Fnodejs.org\u002Fdist\u002Flatest-v10.x\u002Fdocs\u002Fapi\u002Fstream.html#stream_readable_streams)\n    to read the input from. Should only be used in the rare instance you would like to stream anything other than `process.stdin`. Overrides `handleInput`.\n  - `pauseInputStreamOnFinish`: by default, pauses the input stream (`process.stdin` when `handleInput` is enabled, or `inputStream` if provided) when all of the processes have finished. If you need to read from the input stream after `concurrently` has finished, set this to `false`. ([#252](https:\u002F\u002Fgithub.com\u002Fkimmobrunfeldt\u002Fconcurrently\u002Fissues\u002F252)).\n  - `killOthersOn`: once the first command exits with one of these statuses, kill other commands.\n    Can be an array containing the strings `success` (status code zero) and\u002For `failure` (non-zero exit status).\n  - `maxProcesses`: how many processes should run at once.\n  - `outputStream`: a [`Writable` stream](https:\u002F\u002Fnodejs.org\u002Fdist\u002Flatest-v10.x\u002Fdocs\u002Fapi\u002Fstream.html#stream_writable_streams)\n    to write logs to. Default: `process.stdout`.\n  - `prefix`: the prefix type to use when logging processes output.\n    Possible values: `index`, `pid`, `time`, `command`, `name`, `none`, or a template (eg `[{time} process: {pid}]`).\n    Default: the name of the process, or its index if no name is set.\n  - `prefixColors`: a list of colors or a string as supported by [Chalk](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fchalk) and additional style `auto` for an automatically picked color.\n    Supports all Chalk color functions: `#RRGGBB`, `bg#RRGGBB`, `hex()`, `bgHex()`, `rgb()`, `bgRgb()`, `ansi256()`, `bgAnsi256()`.\n    Functions and modifiers can be chained (e.g., `rgb(255,136,0).bold`, `black.bgHex(#00FF00).dim`).\n    If concurrently would run more commands than there are colors, the last color is repeated, unless if the last color value is `auto` which means following colors are automatically picked to vary.\n    Prefix colors specified per-command take precedence over this list.\n  - `prefixLength`: how many characters to show when prefixing with `command`. Default: `10`\n  - `raw`: whether raw mode should be used, meaning strictly process output will\n    be logged, without any prefixes, coloring or extra stuff. Can be overridden per command.\n  - `successCondition`: the condition to consider the run was successful.\n    If `first`, only the first process to exit will make up the success of the run; if `last`, the last process that exits will determine whether the run succeeds.\n    Anything else means all processes should exit successfully.\n  - `restartTries`: how many attempts to restart a process that dies will be made. Default: `0`.\n  - `restartDelay`: how many milliseconds to wait between process restarts. Default: `0`.\n  - `timestampFormat`: a [Unicode format](https:\u002F\u002Fwww.unicode.org\u002Freports\u002Ftr35\u002Ftr35-dates.html#Date_Field_Symbol_Table)\n    to use when prefixing with `time`. Default: `yyyy-MM-dd HH:mm:ss.SSS`\n  - `additionalArguments`: list of additional arguments passed that will get replaced in each command. If not defined, no argument replacing will happen.\n\n> **Returns:** an object in the shape `{ result, commands }`.\n>\n> - `result`: a `Promise` that resolves if the run was successful (according to `successCondition` option),\n>   or rejects, containing an array of [`CloseEvent`](#CloseEvent), in the order that the commands terminated.\n> - `commands`: an array of all spawned [`Command`s](#Command).\n\nExample:\n\n```js\nconst concurrently = require('concurrently');\nconst { result } = concurrently(\n  [\n    'npm:watch-*',\n    { command: 'nodemon', name: 'server' },\n    { command: 'deploy', name: 'deploy', env: { PUBLIC_KEY: '...' } },\n    {\n      command: 'watch',\n      name: 'watch',\n      cwd: path.resolve(__dirname, 'scripts\u002Fwatchers'),\n    },\n  ],\n  {\n    prefix: 'name',\n    killOthersOn: ['failure', 'success'],\n    restartTries: 3,\n    cwd: path.resolve(__dirname, 'scripts'),\n  },\n);\nresult.then(success, failure);\n```\n\n### `Command`\n\nAn object that contains all information about a spawned command, and ways to interact with it.\u003Cbr>\nIt has the following properties:\n\n- `index`: the index of the command among all commands spawned.\n- `command`: the command line of the command.\n- `name`: the name of the command; defaults to an empty string.\n- `cwd`: the current working directory of the command.\n- `env`: an object with all the environment variables that the command will be spawned with.\n- `killed`: whether the command has been killed.\n- `state`: the command's state. Can be one of\n  - `stopped`: if the command was never started\n  - `started`: if the command is currently running\n  - `errored`: if the command failed spawning\n  - `exited`: if the command is not running anymore, e.g. it received a close event\n- `pid`: the command's process ID.\n- `stdin`: a Writable stream to the command's `stdin`.\n- `stdout`: an RxJS observable to the command's `stdout`.\n- `stderr`: an RxJS observable to the command's `stderr`.\n- `error`: an RxJS observable to the command's error events (e.g. when it fails to spawn).\n- `timer`: an RxJS observable to the command's timing events (e.g. starting, stopping).\n- `stateChange`: an RxJS observable for changes to the command's `state` property.\n- `messages`: an object with the following properties:\n  - `incoming`: an RxJS observable for the IPC messages received from the underlying process.\n  - `outgoing`: an RxJS observable for the IPC messages sent to the underlying process.\n\n  Both observables emit [`MessageEvent`](#messageevent)s.\u003Cbr>\n  Note that if the command wasn't spawned with IPC support, these won't emit any values.\n\n- `close`: an RxJS observable to the command's close events.\n  See [`CloseEvent`](#CloseEvent) for more information.\n- `start()`: starts the command and sets up all of the above streams\n- `send(message[, handle, options])`: sends a message to the underlying process via IPC channels,\n  returning a promise that resolves once the message has been sent.\n  See [Node.js docs](https:\u002F\u002Fnodejs.org\u002Fdocs\u002Flatest\u002Fapi\u002Fchild_process.html#subprocesssendmessage-sendhandle-options-callback).\n- `kill([signal])`: kills the command, optionally specifying a signal (e.g. `SIGTERM`, `SIGKILL`, etc).\n\n### `MessageEvent`\n\nAn object that represents a message that was received from\u002Fsent to the underlying command process.\u003Cbr>\nIt has the following properties:\n\n- `message`: the message itself.\n- `handle`: a [`net.Socket`](https:\u002F\u002Fnodejs.org\u002Fdocs\u002Flatest\u002Fapi\u002Fnet.html#class-netsocket),\n  [`net.Server`](https:\u002F\u002Fnodejs.org\u002Fdocs\u002Flatest\u002Fapi\u002Fnet.html#class-netserver) or\n  [`dgram.Socket`](https:\u002F\u002Fnodejs.org\u002Fdocs\u002Flatest\u002Fapi\u002Fdgram.html#class-dgramsocket),\n  if one was sent, or `undefined`.\n\n### `CloseEvent`\n\nAn object with information about a command's closing event.\u003Cbr>\nIt contains the following properties:\n\n- `command`: a stripped down version of [`Command`](#command), including only `name`, `command`, `env` and `cwd` properties.\n- `index`: the index of the command among all commands spawned.\n- `killed`: whether the command exited because it was killed.\n- `exitCode`: the exit code of the command's process, or the signal which it was killed with.\n- `timings`: an object in the shape `{ startDate, endDate, durationSeconds }`.\n\n## FAQ\n\n- Process exited with code _null_?\n\n  From [Node child_process documentation](http:\u002F\u002Fnodejs.org\u002Fapi\u002Fchild_process.html#child_process_event_exit), `exit` event:\n\n  > This event is emitted after the child process ends. If the process\n  > terminated normally, code is the final exit code of the process,\n  > otherwise null. If the process terminated due to receipt of a signal,\n  > signal is the string name of the signal, otherwise null.\n\n  So _null_ means the process didn't terminate normally. This will make **concurrently**\n  to return non-zero exit code too.\n\n- Does this work with the npm-replacements [yarn](https:\u002F\u002Fyarnpkg.com\u002F), [pnpm](https:\u002F\u002Fpnpm.io\u002F), or [Bun](https:\u002F\u002Fbun.sh\u002F)?\n\n  Yes! In all examples above, you may replace \"`npm`\" with \"`yarn`\", \"`pnpm`\", or \"`bun`\".\n","concurrently 是一个用于并行运行多个命令行指令的工具，相比传统的多进程管理方式更为高效和直观。它采用 TypeScript 编写，支持跨平台使用（包括 Windows），并且通过为每个命令的输出添加前缀来提高可读性。此外，concurrently 提供了如 `--kill-others` 的选项，当其中一个进程失败时可以自动终止其他所有进程，从而简化了开发过程中的错误处理。此工具非常适合前端开发人员在同时监听 JavaScript 和样式文件变化等场景中使用，能够显著提升工作效率。","2026-06-11 03:27:59","top_topic"]