antfu-collective / ni

💡 Use the right package manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[nr] Use `bun` for running scripts, if installed

aleclarson opened this issue · comments

Clear and concise description of the problem

Bun is the fastest I've seen at running npm scripts.

Suggested solution

Check for bun's existence and use it if possible

Alternative

No response

Additional context

No response

Validations

You might think, "Why not just use bun directly?"

The answer is, if I'm using nr in a npm script, I can't know bun is installed on a contributor's machine

I feel this could be a dangerous implicit move. If you use bun.lockb, nr will already run bun to execute. For other agents, I don't think the npm run pnpm run yarn run bun are 100% equivalent.