{"name":"@semantic-release/npm","version":"13.0.0-alpha.2","keywords":["npm","publish","registry","semantic-release","version"],"author":{"url":"https://twitter.com/@pvdlg_","name":"Pierre Vanduynslager"},"license":"MIT","_id":"@semantic-release/npm@13.0.0-alpha.2","maintainers":[{"name":"pvdlg","email":"pierre.denis.vanduynslager@gmail.com"},{"name":"semantic-release-bot","email":"semantic-release@martynus.net"},{"name":"gr2m","email":"gregor@martynus.net"},{"name":"travi","email":"npm@travi.org"}],"contributors":[{"url":"http://boennemann.me","name":"Stephan Bönnemann","email":"stephan@boennemann.me"},{"url":"https://twitter.com/gr2m","name":"Gregor Martynus"}],"homepage":"https://github.com/semantic-release/npm#readme","bugs":{"url":"https://github.com/semantic-release/npm/issues"},"c8":{"all":true,"include":["lib/**/*.js","index.js"],"reporter":["json","text","html"]},"ava":{"files":["test/**/*.test.js","!test/integration.test.js"],"timeout":"2m","workerThreads":false},"dist":{"shasum":"a1445191de8127f252442b0e5f66a05316355498","tarball":"http://registry-npm.ywwl.com/@semantic-release/npm/download/@semantic-release/npm-13.0.0-alpha.2.tgz","fileCount":16,"integrity":"sha512-yNx5GR7ywa5nt+oyUnaaNO2xiLKepB5qfgzNLM0+ZPhpVyAFVT/vUVUyWPoZmcshuRBqGxNJBELIbjcS3Nl9Qg==","signatures":[{"sig":"MEUCIQCl1ejSFTpDAt4DShJcJ28t+iQ49cAo8A8qI36qOnPb/QIgfO34VZfVt18BCjhUuYFyo5+CA8AuB8Ysv9dz5JudUFk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@semantic-release%2fnpm@13.0.0-alpha.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":29249,"size":8291,"noattachment":false,"key":"/@semantic-release/npm/-/@semantic-release/npm-13.0.0-alpha.2.tgz"},"main":"./index.js","type":"module","engines":{"node":"^22.14.0 || >= 24.2.0"},"exports":"./index.js","gitHead":"733fe89c342e1dee53e376cb17e7088606ddb8d7","scripts":{"lint":"prettier --check \"{lib,test}/**/*.{js,json,ts}\" \"*.{md,json,js}\" \".github/**/*.yml\"","test":"npm-run-all --print-label --parallel lint:* --parallel test:*","test:unit":"c8 ava --verbose","lint:engines":"ls-engines","lint:publish":"publint --strict","lint:lockfile":"lockfile-lint","lint:prettier":"prettier --check \"{lib,test}/**/*.{js,json,ts}\" \"*.{md,json,js}\" \".github/**/*.yml\"","test:integration":"ava --verbose test/integration.test.js","lint:prettier:fix":"prettier --write \"*.{js,json,md}\" \".github/**/*.{md,yml}\" \"{bin,lib,test}/**/*.js\""},"_npmUser":{"name":"semantic-release-bot","actor":{"name":"semantic-release-bot","type":"user","email":"semantic-release@martynus.net"},"email":"semantic-release@martynus.net"},"prettier":{"printWidth":120,"trailingComma":"es5"},"renovate":{"extends":["github>semantic-release/.github:renovate-config"]},"repository":{"url":"git+https://github.com/semantic-release/npm.git","type":"git"},"_npmVersion":"11.4.2","description":"semantic-release plugin to publish a npm package","directories":{},"_nodeVersion":"22.17.0","dependencies":{"rc":"^1.2.8","npm":"github:npm/cli#oidc","execa":"^9.0.0","tempy":"^3.0.0","semver":"^7.1.2","fs-extra":"^11.0.0","read-pkg":"^9.0.0","lodash-es":"^4.17.21","nerf-dart":"^1.0.0","normalize-url":"^8.0.0","aggregate-error":"^5.0.0","registry-auth-token":"^5.0.0","@semantic-release/error":"^4.0.0"},"lockfile-lint":{"path":"package-lock.json","type":"npm","allowed-hosts":["npm"],"validate-https":true},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"packageManager":"npm@11.4.2","readmeFilename":"README.md","devDependencies":{"c8":"10.1.3","ava":"6.4.0","got":"14.4.7","sinon":"21.0.0","p-retry":"6.2.1","publint":"0.3.12","prettier":"3.5.3","dockerode":"4.0.7","ls-engines":"0.9.3","strip-ansi":"7.1.0","npm-run-all2":"8.0.4","lockfile-lint":"4.14.1","stream-buffers":"3.0.3","semantic-release":"24.2.5"},"peerDependencies":{"semantic-release":">=20.1.0"},"_npmOperationalInternal":{"tmp":"tmp/npm_13.0.0-alpha.2_1752038120792_0.002500800200122111","host":"s3://npm-registry-packages-npm-production"},"readme":"# @semantic-release/npm\n\n[**semantic-release**](https://github.com/semantic-release/semantic-release) plugin to publish a [npm](https://www.npmjs.com) package.\n\n[![Build Status](https://github.com/semantic-release/npm/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/semantic-release/npm/actions/workflows/test.yml?query=branch%3Amaster)\n[![npm latest version](https://img.shields.io/npm/v/@semantic-release/npm/latest.svg)](https://www.npmjs.com/package/@semantic-release/npm)\n[![npm next version](https://img.shields.io/npm/v/@semantic-release/npm/next.svg)](https://www.npmjs.com/package/@semantic-release/npm)\n[![npm beta version](https://img.shields.io/npm/v/@semantic-release/npm/beta.svg)](https://www.npmjs.com/package/@semantic-release/npm)\n\n| Step               | Description                                                                                                                      |\n| ------------------ | -------------------------------------------------------------------------------------------------------------------------------- |\n| `verifyConditions` | Verify the presence of the `NPM_TOKEN` environment variable, or an `.npmrc` file, and verify the authentication method is valid. |\n| `prepare`          | Update the `package.json` version and [create](https://docs.npmjs.com/cli/pack) the npm package tarball.                         |\n| `addChannel`       | [Add a release to a dist-tag](https://docs.npmjs.com/cli/dist-tag).                                                              |\n| `publish`          | [Publish the npm package](https://docs.npmjs.com/cli/publish) to the registry.                                                   |\n\n## Install\n\n> [!TIP]\n> You do not need to directly depend on this package if you are using `semantic-release`.\n> `semantic-release` already depends on this package, and defining your own direct dependency can result in conflicts when you update `semantic-release`.\n\n```bash\n$ npm install @semantic-release/npm -D\n```\n\n## Usage\n\nThe plugin can be configured in the [**semantic-release** configuration file](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration):\n\n```json\n{\n  \"plugins\": [\"@semantic-release/commit-analyzer\", \"@semantic-release/release-notes-generator\", \"@semantic-release/npm\"]\n}\n```\n\n## Configuration\n\n### npm registry authentication\n\n### Official Registry\n\nWhen publishing to the [official registry](https://registry.npmjs.org/), it is recommended to publish with authentication intended for automation:\n\n- For improved security, and since access tokens have recently had their [maximum lifetimes restricted](https://github.blog/changelog/2025-09-29-strengthening-npm-security-important-changes-to-authentication-and-token-management/),\n  [trusted publishing](https://docs.npmjs.com/trusted-publishers) is recommended when publishing from a [supported CI provider](https://docs.npmjs.com/trusted-publishers#supported-cicd-providers)\n- [Granular access tokens](https://docs.npmjs.com/creating-and-viewing-access-tokens#creating-granular-access-tokens-on-the-website) are recommended when publishing from a CI provider that is not supported by npm for trusted publishing, and can be set via [environment variables](#environment-variables).\n  Because these access tokens expire, rotation will need to be accounted for in this scenario.\n\n> [!NOTE]\n> When using trusted publishing, provenance attestations are automatically generated for your packages without requiring provenance to be explicitly enabled.\n\n#### Trusted publishing from GitHub Actions\n\nTo leverage trusted publishing and publish with provenance from GitHub Actions, the `id-token: write` permission is required to be enabled on the job:\n\n```yaml\npermissions:\n  id-token: write # to enable use of OIDC for trusted publishing and npm provenance\n```\n\nIt's also worth noting that if you are using semantic-release to its fullest with a GitHub release, GitHub comments,\nand other features, then [more permissions are required](https://github.com/semantic-release/github#github-authentication) to be enabled on this job:\n\n```yaml\npermissions:\n  contents: write # to be able to publish a GitHub release\n  issues: write # to be able to comment on released issues\n  pull-requests: write # to be able to comment on released pull requests\n  id-token: write # to enable use of OIDC for trusted publishing and npm provenance\n```\n\nRefer to the [GitHub Actions recipe for npm package provenance](https://semantic-release.gitbook.io/semantic-release/recipes/ci-configurations/github-actions#.github-workflows-release.yml-configuration-for-node-projects) for the full CI job's YAML code example.\n\n#### Trusted publishing for GitLab Pipelines\n\nTo leverage trusted publishing and publish with provenance from GitLab Pipelines, `NPM_ID_TOKEN` needs to be added as an entry under `id_tokens` in the job definition with an audience of `npm:registry.npmjs.org`:\n\n```yaml\nid_tokens:\n  NPM_ID_TOKEN:\n    aud: \"npm:registry.npmjs.org\"\n```\n\nSee the [npm documentation for more details about configuring pipeline details](https://docs.npmjs.com/trusted-publishers#gitlab-cicd-configuration)\n\n#### Unsupported CI providers\n\nToken authentication is **required** and can be set via [environment variables](#environment-variables).\n[Granular access tokens](https://docs.npmjs.com/creating-and-viewing-access-tokens#creating-granular-access-tokens-on-the-website) are recommended in this scenario, since trusted publishing is not available from all CI providers.\nBecause these access tokens expire, rotation will need to be accounted for in your process.\n\n### Alternative Registries\n\nToken authentication is **required** and can be set via [environment variables](#environment-variables).\nSee the documentation for your registry for details on how to create a token for automation.\n\n### Environment variables\n\n| Variable    | Description                                                                                                                   |\n| ----------- | ----------------------------------------------------------------------------------------------------------------------------- |\n| `NPM_TOKEN` | Npm token created via [npm token create](https://docs.npmjs.com/getting-started/working_with_tokens#how-to-create-new-tokens) |\n\n### Options\n\n| Options      | Description                                                                                                        | Default                                                                                                                          |\n| ------------ | ------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |\n| `npmPublish` | Whether to publish the `npm` package to the registry. If `false` the `package.json` version will still be updated. | `false` if the `package.json` [private](https://docs.npmjs.com/files/package.json#private) property is `true`, `true` otherwise. |\n| `pkgRoot`    | Directory path to publish.                                                                                         | `.`                                                                                                                              |\n| `tarballDir` | Directory path in which to write the package tarball. If `false` the tarball is not be kept on the file system.    | `false`                                                                                                                          |\n\n**Note**: The `pkgRoot` directory must contain a `package.json`. The version will be updated only in the `package.json` and `npm-shrinkwrap.json` within the `pkgRoot` directory.\n\n**Note**: If you use a [shareable configuration](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/shareable-configurations.md#shareable-configurations) that defines one of these options you can set it to `false` in your [**semantic-release** configuration](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration) in order to use the default value.\n\n### npm configuration\n\nThe plugin uses the [`npm` CLI](https://github.com/npm/cli) which will read the configuration from [`.npmrc`](https://docs.npmjs.com/files/npmrc). See [`npm config`](https://docs.npmjs.com/misc/config) for the option list.\n\nThe [`registry`](https://docs.npmjs.com/misc/registry) can be configured via the npm environment variable `NPM_CONFIG_REGISTRY` and will take precedence over the configuration in `.npmrc`.\n\nThe [`registry`](https://docs.npmjs.com/misc/registry), [`dist-tag`](https://docs.npmjs.com/cli/dist-tag), and [`provenance`](https://docs.npmjs.com/generating-provenance-statements#using-third-party-package-publishing-tools) can be configured under `publishConfig` in the `package.json`:\n\n```json\n{\n  \"publishConfig\": {\n    \"registry\": \"https://registry.npmjs.org/\",\n    \"tag\": \"latest\",\n    \"provenance\": true\n  }\n}\n```\n\n**Notes**:\n\n- The presence of an `.npmrc` file will override any specified environment variables.\n- The presence of `registry` or `dist-tag` under `publishConfig` in the `package.json` will take precedence over the configuration in `.npmrc` and `NPM_CONFIG_REGISTRY`\n\n### Examples\n\nThe `npmPublish` and `tarballDir` option can be used to skip the publishing to the `npm` registry and instead, release the package tarball with another plugin. For example with the [@semantic-release/github](https://github.com/semantic-release/github) plugin:\n\n```json\n{\n  \"plugins\": [\n    \"@semantic-release/commit-analyzer\",\n    \"@semantic-release/release-notes-generator\",\n    [\n      \"@semantic-release/npm\",\n      {\n        \"npmPublish\": false,\n        \"tarballDir\": \"dist\"\n      }\n    ],\n    [\n      \"@semantic-release/github\",\n      {\n        \"assets\": \"dist/*.tgz\"\n      }\n    ]\n  ]\n}\n```\n\nWhen publishing from a sub-directory with the `pkgRoot` option, the `package.json` and `npm-shrinkwrap.json` updated with the new version can be moved to another directory with a `postversion`. For example with the [@semantic-release/git](https://github.com/semantic-release/git) plugin:\n\n```json\n{\n  \"plugins\": [\n    \"@semantic-release/commit-analyzer\",\n    \"@semantic-release/release-notes-generator\",\n    [\n      \"@semantic-release/npm\",\n      {\n        \"pkgRoot\": \"dist\"\n      }\n    ],\n    [\n      \"@semantic-release/git\",\n      {\n        \"assets\": [\"package.json\", \"npm-shrinkwrap.json\"]\n      }\n    ]\n  ]\n}\n```\n\n```json\n{\n  \"scripts\": {\n    \"postversion\": \"cp -r package.json .. && cp -r npm-shrinkwrap.json ..\"\n  }\n}\n```\n","publish_time":1752038121017,"_cnpm_publish_time":1752038121017,"dist-tags":{"alpha":"13.1.0-alpha.13","beta":"14.0.0-beta.2","latest":"13.2.0","next":"9.0.0"}}