I am new to node, and am watching videos/instructions on installations. I see some installs have a @
npm install @babel/preset-env
while some don't,
npm install http-server
What is the difference?
I am new to node, and am watching videos/instructions on installations. I see some installs have a @
npm install @babel/preset-env
while some don't,
npm install http-server
What is the difference?
This is a feature called "scopes".
When you sign up for an npm user account or create an Org, you are granted a scope that matches your user or Org name. You can use this scope as a namespace for related packages.
A scope allows you to create a package with the same name as a package created by another user or Org without conflict.
When listed as a dependent in a
package.json
file, scoped packages are preceded by their scope name. The scope name is everything between the@
and the slash:
http-server
is not a scoped package whereas for example @sinonjs/text-encoding
is.
All npm packages have a name. Some package names also have a scope. A scope follows the usual rules for package names (URL-safe characters, no leading dots or underscores). When used in package names, scopes are preceded by an @ symbol and followed by a slash, e.g.
It's especially useful for companies with private repos but has gained popularity with open source in recent years.