https://github.com/alloc/picorun
Parallel task runner with a CLI and a JS API
https://github.com/alloc/picorun
nodejs task-runner
Last synced: 6 months ago
JSON representation
Parallel task runner with a CLI and a JS API
- Host: GitHub
- URL: https://github.com/alloc/picorun
- Owner: alloc
- License: mit
- Created: 2025-04-05T19:59:43.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-04-06T19:24:25.000Z (10 months ago)
- Last Synced: 2025-07-17T19:48:27.482Z (7 months ago)
- Topics: nodejs, task-runner
- Language: TypeScript
- Homepage:
- Size: 28.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# picorun
Run commands in parallel, with labels and colors, from CLI or JS. Automatically finds executables in `./node_modules/.bin`.
```sh
pnpm add picorun
```
## CLI Usage
```sh
picorun "cmd1" "cmd2" --names=name1,name2 --filter "name1"
```
Options:
- `--names`: Comma-separated list of custom names for each command.
- `--filter`: Run only tasks matching the given name pattern (can be used multiple times). Wildcards (`*`) are supported.
## API Usage
```js
import picorun from 'picorun'
const tasks = picorun(
// Tasks definition
[
{ cmd: 'cmd1', name: 'Task 1' },
{ cmd: 'cmd2', name: 'Task 2' },
{ cmd: 'cmd3', name: 'Another Task' },
],
// Options
{
// Only run tasks named 'Task 1' or 'Task 2'
filter: ['Task 1', 'Task 2'],
}
)
tasks[0].name // => 'Task 1'
tasks[0].subprocess // => [object ChildProcess]
// Wait for one task to complete
await tasks[0]
// Wait for all tasks to complete
await tasks
```
## Prior Art
- [tinyrun](https://github.com/microlinkhq/tinyrun)