Creating and publishing an organization scoped package


Skip to content



npm Docs



npmjs.comStatusSupport






About npm
Getting started
Packages and modules
Integrations

Organizations
Creating and managing organizations
Paying for your organization
Managing organization members
Managing teams

Managing organization packages
About organization scopes and packagesConfiguring your npm client with your organization settingsCreating and publishing an organization scoped package




Policies
Threats and Mitigations
npm CLI



Table of contents
Creating an organization scoped package
Publishing a private organization scoped package
Publishing a public organization scoped package



As an organization member, you can create and publish public and private packages within the organization's scope.

Creating an organization scoped package


On the command line, make a directory with the name of the package you would like to create.

mkdir /path/to/package/directory


Navigate to the newly-created package directory.

To create an organization scoped package, on the command line, run:

npm init --scope=<your_org_name>


To verify the package is using your organization scope, in a text editor, open the package's package.json file and check that the name is @your_org_name/<pkg_name>, replacing your_org_name with the name of your organization.


Publishing a private organization scoped package
By default, npm publish will publish a scoped package as private.
By default, any scoped package is published as private. However, if you have an organization that does not have the Private Packages feature, npm publish will fail unless you pass the access flag.

On the command line, navigate to the package directory.
Run npm publish.

Private packages will say private below the package name on the npm website.


Publishing a public organization scoped package
To publish an organization scoped package as public, use npm publish --access public.

On the command line, navigate to the package directory.
Run npm publish --access public.

Public packages will say public below the package name on the npm website.

Edit this page on GitHub







    
{'path': 'public/docs/npm/creating-and-publishing-an-organization-scoped-package.html', 'source': 'DevDocs.IO'}