All npm
packages have a name.
scope
.Scopes
are a way of grouping related packages together.
@somescope/somepackagename import "@somescope/somepackagename"
In broader scope of npm
publishing, @scope
should be a name of a user or an organization.
@username/module
@org/module
You HAVE to name the scope
with @
prefixed if it is an npm
package.
npm scope
if not prefixed with @
List the named scopes in NPM
npm list
Initialize Scoped package
# in the package root directory npm init --scope=@scope_name
If you want to privately publish a package, you need a npm Private Module
account
npm publish --access restricted
For publishing publicly
npm publish --access public