Skip to content

bun run-parallel and bun run-sequential cli commands #7589

@DanielFGray

Description

@DanielFGray

What is the problem this feature would solve?

there's often a need to run multiple package.json scripts at a time, either sequentially or in parallel

one sometimes/often sees package.json scripts like "npm run some:task && npm run another:task && npm run yet:another --with-args", and there are also packages like concurrently to run multiple [shell] commands at a time...

What is the feature you are proposing to solve the problem?

two commands (and an alias for each), emulating the api of npm package npm-run-all

  • bun run-sequential (alias bun run-s) to run multiple scripts in sequence, allowing one failed script to exit early unless a flag specifies otherwise; the above example could be done with
    bun run-s some:task another:task 'yet:another --with-args'
  • bun run-parallel (alias bun run-p) to run multiple scripts in sequence, allowing one failed script to exit all of them (unless a flag specifies otherwise); the same example above would likely make 3 child processes

how stdin is shared with parallel scripts is undefined

What alternatives have you considered?

this could of course be left to the user to install the npm-run-all package, but that package seems to be mostly unmaintained, and sometimes leaves dangling processes [ime]
I think having it as a native cli command in bun would be a fantastic addition to bun

Metadata

Metadata

Assignees

Labels

cliSomething to do with CLI argumentsenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions