Skip to content

Change the default user agent of nodejs #48711

@renhiyama

Description

@renhiyama

What is the problem this feature will solve?

https://esm.sh supports auto targeting the build (ie. bundling code for specific runtime) by looking at the user agent.
The user agent they support (and probably some other websites) is like Node/{version}. Deno too uses a similar user agent - Deno/{version}.

Since I don't see any specific user agent used officially by nodejs (other than the library name it uses, ie. undici on v18+ and node-fetch for below than v16), I would like to see a unified user agent system, considering nobody created an issue on this, I believe this wouldn't break any existing system, instead it would help unifying the system against everyone's code.

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

Use Node/{version} as the user agent by default. Promotes URL imports usage from https://esm.sh and having same name across codes and having similar agent to Deno.

What alternatives have you considered?

I work on my own URL imports implementation, so I'm free to use URL imports from nodejs v16, have Node/* as my user agent and fix stuff/improve performance. Incase anyone is interested, check out @reejs/imports on npm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateIssues and PRs that are duplicates of other issues or PRs.esmIssues and PRs related to the ECMAScript Modules implementation.feature requestIssues that request new features to be added to Node.js.httpIssues or PRs related to the http subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions