Open MKRhere opened 11 months ago
Do you know which registeries are depending on this user-agent value?
I'm writing a personal registry which makes use of this to deliver a tarball for npm, pnpm, yarn, and bun, TS for Deno, and JS for web. We're hoping to use this for the telegraf and hyperactive projects.
I just think it's a very low effort addition to add a little bit more info to be compat with the other package managers (surely they all do it because someone depends on it?)
What is the problem this feature would solve?
When running
bun install
with a URL, servers that resolve the same URL differently for different types of requests could check for the useragentnpm
to resolve in an npm-like manner.In my tests, this is what npm, pnpm, and yarn do:
Bun sends this:
What is the feature you are proposing to solve the problem?
Bun could definitely add
npm/? linux x64
to the user-agent string. This would give enough information for the server to deliver the correct package.What alternatives have you considered?
We could look for both
npm
andBun
user-agents, but since they are compatible package-wise, I do not think servers should not need to care about it. OS and arch information would be great to deliver different native binaries, although my use-case does not demand this.Addendum
Additionally, npm sends even more information, such as
But I don't believe these are necessary. pnpm and yarn don't do this.
npm, yarn, and bun send this, but not pnpm: