kartykp/gat-bypass-2fa-docs
@reggi/path-to-regexp
dependabot/npm_and_yarn/main/copy-to-clipboard-4.0.2
dependabot/npm_and_yarn/main/eslint-10.4.0
dependabot/npm_and_yarn/main/npmcli/eslint-config-7.0.0
dependabot/npm_and_yarn/main/proc-log-7.0.0
dependabot/npm_and_yarn/npm_and_yarn-826852524d
dependabot/npm_and_yarn/npm_and_yarn-ab9a7f4bc2
deprecate-totp-2fa
dhei/classic-tokens
gat-bypass-2fa-docs
jpg619/fix-accessibility-content-flow
jpg619/version-bump-tar-2
kartykp/gat-bypass-2fa-docs
kartykp/upgrade-path-to-regex
main
maitxn/version-bump-tar
patch-1
reggi/cache-based-on-version
reggi/dev-engines
reggi/fix-transform-prettier
reggi/overrides
update-search-sensitivity
| 1 | --- |
| 2 | title: Creating and publishing an organization scoped package |
| 3 | redirect_from: |
| 4 | - /creating-and-publishing-an-org-scoped-package |
| 5 | --- |
| 6 | |
| 7 | import shared from '~/shared.js' |
| 8 | |
| 9 | As an organization member, you can create and publish public and private packages within the organization's scope. |
| 10 | |
| 11 | ## Creating an organization scoped package |
| 12 | |
| 13 | 1. On the command line, make a directory with the name of the package you would like to create. |
| 14 | |
| 15 | ``` |
| 16 | mkdir /path/to/package/directory |
| 17 | ``` |
| 18 | |
| 19 | 2. Navigate to the newly-created package directory. |
| 20 | |
| 21 | 3. To create an organization scoped package, on the command line, run: |
| 22 | |
| 23 | ``` |
| 24 | npm init --scope=<your_org_name> |
| 25 | ``` |
| 26 | |
| 27 | 4. 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. |
| 28 | |
| 29 | ## Publishing a private organization scoped package |
| 30 | |
| 31 | By default, `npm publish` will publish a scoped package as private. |
| 32 | |
| 33 | 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. |
| 34 | |
| 35 | 1. On the command line, navigate to the package directory. |
| 36 | |
| 37 | 2. Run `npm publish`. |
| 38 | |
| 39 | Private packages will say `private` below the package name on the npm website. |
| 40 | |
| 41 | <>{shared['organization-package-private'].image}</> |
| 42 | |
| 43 | ## Publishing a public organization scoped package |
| 44 | |
| 45 | To publish an organization scoped package as public, use `npm publish --access public`. |
| 46 | |
| 47 | 1. On the command line, navigate to the package directory. |
| 48 | |
| 49 | 2. Run `npm publish --access public`. |
| 50 | |
| 51 | Public packages will say `public` below the package name on the npm website. |
| 52 | |
| 53 | <>{shared['organization-package-public'].image}</> |