Home >Web Front-end >JS Tutorial >What are Scoped Packages in npm and Why Do They Use the '@' Prefix?
Understanding the Prefix "@" in npm Package Names
In the context of the Angular Component Router, you encountered an unfamiliar command using the prefix "@":
npm install @angular/router --save
This prefix represents a significant feature in npm known as "scoped packages."
What are Scoped Packages?
Scoped packages are a mechanism introduced in npm that allows packages to be namespaced within user or organization accounts. Each account has its own unique scope, ensuring that packages within that scope are unique to the account.
Benefits of Scoped Packages:
Why Don't Scoped Packages Show Up in Search?
Historically, some scoped packages were private and excluded from public search results to protect sensitive information. Organizations wanted to ensure they had full control over what was publicly available.
Current Availability of Scoped Packages in Search
Recently, npm has made changes to allow public scoped packages to appear in search results. This improvement provides greater visibility and discoverability for packages within organizational scopes.
Additional Resources
For more detailed information on scoped packages, refer to the following resources:
The above is the detailed content of What are Scoped Packages in npm and Why Do They Use the '@' Prefix?. For more information, please follow other related articles on the PHP Chinese website!