Skip to content

Bunx: support specifying package to install #7034

Open
@davidlj95

Description

@davidlj95

What is the problem this feature would solve?

If the binary to run is not named same as the package, you won't be able to run it with bunx. There are some binaries included in packages that don't have same name as package.

For instance, Renovate: a tool to update dependencies. Their package provides two binaries:

  1. renovate (same as package name) to run the dependencies update bot
  2. renovate-config-validator: to validate your config

You can run the bot with bunx renovate. But you can't run the renovate-config-validator using bunx right now.

Other package managers offer the -p CLI option to specify which package to install, then the first argument is the binary to run. For instance, following previous example:

  • NPM offers npm exec --package/npx -p|--package
    We can run the script with:
    • npm exec --package renovate renovate-config-validator
    • npx --package renovate renovate-config-validator
  • Yarn (berry) offers yarn dlx -p|--package
    We can run the script with:
    • yarn dlx -p renovate renovate-config-validator

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

Would be nice to have also some -p or --package to enable this use case :)

What alternatives have you considered?

Installing the dependency, then use bun run with path to script in node_modules directory. But the great of bunx is to just install and run for dependencies that won't be needed often. Like validating the configuration of your dependencies update tool.

Until then, other package managers can be used for this purpose

Metadata

Metadata

Assignees

No one assigned

    Labels

    bun installSomething that relates to the npm-compatible clientenhancementNew feature or requestgood first issueSomething that would be good for new contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions