Proposal: Add Badge for Client-Side, Server-Side, or Universal Packages #139312
Replies: 1 comment
-
This is a great idea! Adding badges or clear indicators to specify whether npm packages are designed for client-side, server-side, or both would certainly streamline development workflows, especially when working in environments that involve both the browser and Node.js I give my suggestions:
Overall, this would be a great addition to NPM, and I think many developer would appreciate the clarity and efficiency it would bring to their workflows. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
I would like to start a discussion around adding badges or clear indicators to npm packages that specify whether they are designed to run on the client side, server side, or both.
Problem:
When using npm packages, it can often be difficult to determine where a package is supposed to be executed. Some libraries are specific to the browser, others to Node.js, and some can work in both environments. Unfortunately, there’s no standard way to quickly identify this from the package name or description. This becomes especially challenging when working in mixed environments or migrating code between client and server.
We currently have badges for things like TypeScript declarations (e.g.,
dt
for DefinitelyTyped) that make it easy to know whether a package supports TypeScript or has built-in types, but no similar standard exists for the runtime environment.Proposal:
Introduce a standard badge system or metadata flag that can be used in the package.json or on the npm package page to show:
These badges could appear next to the package name on npm, similar to how the TypeScript badges are displayed, helping developers immediately know the intended runtime environment.
Benefits:
I’d love to hear feedback from the community on this! Is this something you’ve run into, and would you find these types of badges useful? What other challenges do you face in identifying the appropriate environment for npm packages?
Beta Was this translation helpful? Give feedback.
All reactions