@semantic-release/npm
semantic-release plugin to publish a npm package
Last updated 6 years ago by semantic-release-bot .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @semantic-release/npm 
SYNC missed versions from official npm registry.

@semantic-release/npm

semantic-release plugin to publish a npm package.

Travis Codecov Greenkeeper badge

npm latest version npm next version npm beta version

Step Description
verifyConditions Verify the presence of the NPM_TOKEN environment variable, create or update the .npmrc file with the token and verify the token is valid.
prepare Update the package.json version and create the npm package tarball.
addChannel Add a release to a dist-tag.
publish Publish the npm package to the registry.

Install

$ npm install @semantic-release/npm -D

Usage

The plugin can be configured in the semantic-release configuration file:

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "@semantic-release/npm",
  ]
}

Configuration

Npm registry authentication

The npm authentication configuration is required and can be set via environment variables.

Both the token and the legacy (username, password and email) authentication are supported. It is recommended to use the token authentication. The legacy authentication is supported as the alternative npm registries Artifactory and npm-registry-couchapp only supports that form of authentication.

Note: Only the auth-only level of npm two-factor authentication is supported, semantic-release will not work with the default auth-and-writes level.

Environment variables

Variable Description
NPM_TOKEN Npm token created via npm token create
NPM_USERNAME Npm username created via npm adduser or on npmjs.com
NPM_PASSWORD Password of the npm user.
NPM_EMAIL Email address associated with the npm user

Use either NPM_TOKEN for token authentication or NPM_USERNAME, NPM_PASSWORD and NPM_EMAIL for legacy authentication

Options

Options Description Default
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 property is true, true otherwise.
pkgRoot Directory path to publish. .
tarballDir Directory path in which to write the the package tarball. If false the tarball is not be kept on the file system. false

Note: The pkgRoot directory must contains a package.json. The version will be updated only in the package.json and npm-shrinkwrap.json within the pkgRoot directory.

Note: If you use a shareable configuration that defines one of these options you can set it to false in your semantic-release configuration in order to use the default value.

Npm configuration

The plugin uses the npm CLI which will read the configuration from .npmrc. See npm config for the option list.

The registry and dist-tag can be configured in the package.json and will take precedence over the configuration in .npmrc:

{
  "publishConfig": {
    "registry": "https://registry.npmjs.org/",
    "tag": "latest"
  }
}

Examples

The 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 plugin:

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    ["@semantic-release/npm", {
      "npmPublish": false,
      "tarballDir": "dist",
    }],
    ["@semantic-release/github", {
      "assets": "dist/*.tgz"
    }]
  ]
}

When 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 postpublish npm script. For example with the @semantic-release/git plugin:

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    ["@semantic-release/npm", {
      "pkgRoot": "dist",
    }],
    ["@semantic-release/git", {
      "assets": ["package.json", "npm-shrinkwrap.json"]
    }]
  ]
}
{
  "scripts": {
    "postpublish": "cp -r dist/package.json . && cp -r dist/npm-shrinkwrap.json ."
  }
}

Current Tags

  • 10.0.0-beta.4                                ...           beta (2 years ago)
  • 12.0.1                                ...           latest (6 months ago)
  • 9.0.0                                ...           next (3 years ago)

130 Versions

  • 12.0.1                                ...           6 months ago
  • 12.0.0                                ...           8 months ago
  • 11.0.3                                ...           8 months ago
  • 11.0.2                                ...           a year ago
  • 11.0.1                                ...           a year ago
  • 11.0.0                                ...           a year ago
  • 10.0.6                                ...           a year ago
  • 10.0.5                                ...           a year ago
  • 10.0.4                                ...           a year ago
  • 10.0.3                                ...           2 years ago
  • 10.0.2                                ...           2 years ago
  • 10.0.1                                ...           2 years ago
  • 10.0.0                                ...           2 years ago
  • 10.0.0-beta.4                                ...           2 years ago
  • 10.0.0-beta.3                                ...           2 years ago
  • 10.0.0-beta.2                                ...           2 years ago
  • 9.0.2                                ...           2 years ago
  • 10.0.0-beta.1                                ...           2 years ago
  • 9.0.1                                ...           3 years ago
  • 9.0.0                                ...           3 years ago
  • 9.0.0-beta.3                                ...           3 years ago
  • 9.0.0-beta.2                                ...           3 years ago
  • 9.0.0-beta.1                                ...           3 years ago
  • 8.0.4-beta.1                                ...           3 years ago
  • 8.0.3                                ...           3 years ago
  • 8.0.2                                ...           3 years ago
  • 8.0.1                                ...           3 years ago
  • 8.0.0                                ...           3 years ago
  • 8.0.0-beta.1                                ...           3 years ago
  • 7.1.3                                ...           4 years ago
  • 7.1.2                                ...           4 years ago
  • 7.1.1                                ...           4 years ago
  • 7.1.0                                ...           4 years ago
  • 7.0.10                                ...           4 years ago
  • 7.0.9                                ...           4 years ago
  • 7.0.8                                ...           4 years ago
  • 7.0.7                                ...           4 years ago
  • 7.0.6                                ...           4 years ago
  • 7.0.5                                ...           5 years ago
  • 7.0.4                                ...           5 years ago
  • 7.0.3                                ...           5 years ago
  • 7.0.2                                ...           5 years ago
  • 7.0.1                                ...           5 years ago
  • 7.0.0                                ...           5 years ago
  • 6.0.0                                ...           5 years ago
  • 6.0.0-beta.9                                ...           5 years ago
  • 5.3.5                                ...           5 years ago
  • 6.0.0-beta.8                                ...           5 years ago
  • 6.0.0-beta.7                                ...           5 years ago
  • 6.0.0-beta.6                                ...           5 years ago
  • 6.0.0-beta.5                                ...           5 years ago
  • 6.0.0-beta.4                                ...           5 years ago
  • 5.3.4                                ...           5 years ago
  • 5.3.3                                ...           5 years ago
  • 6.0.0-beta.3                                ...           5 years ago
  • 5.3.2                                ...           5 years ago
  • 5.3.1                                ...           5 years ago
  • 6.0.0-beta.2                                ...           5 years ago
  • 6.0.0-beta.1                                ...           5 years ago
  • 5.3.0                                ...           5 years ago
  • 5.2.0                                ...           5 years ago
  • 5.2.0-beta.9                                ...           5 years ago
  • 5.2.0-beta.8                                ...           5 years ago
  • 5.2.0-beta.7                                ...           5 years ago
  • 5.1.15                                ...           5 years ago
  • 5.1.14                                ...           5 years ago
  • 5.1.13                                ...           5 years ago
  • 5.1.12                                ...           5 years ago
  • 5.1.11                                ...           5 years ago
  • 5.1.10                                ...           5 years ago
  • 5.1.9                                ...           5 years ago
  • 5.1.8                                ...           6 years ago
  • 5.1.7                                ...           6 years ago
  • 5.1.6                                ...           6 years ago
  • 5.1.5                                ...           6 years ago
  • 5.2.0-beta.6                                ...           6 years ago
  • 5.1.4                                ...           6 years ago
  • 5.2.0-beta.5                                ...           6 years ago
  • 5.1.3                                ...           6 years ago
  • 5.2.0-beta.4                                ...           6 years ago
  • 5.2.0-beta.3                                ...           6 years ago
  • 5.2.0-beta.2                                ...           6 years ago
  • 5.1.2                                ...           6 years ago
  • 5.2.0-beta.1                                ...           6 years ago
  • 5.1.1                                ...           6 years ago
  • 5.1.0                                ...           6 years ago
  • 5.0.6                                ...           6 years ago
  • 5.0.5                                ...           6 years ago
  • 5.0.4                                ...           6 years ago
  • 5.0.3                                ...           6 years ago
  • 5.0.2                                ...           6 years ago
  • 5.0.1                                ...           6 years ago
  • 5.0.0                                ...           6 years ago
  • 4.0.2                                ...           6 years ago
  • 4.0.1                                ...           6 years ago
  • 4.0.0                                ...           6 years ago
  • 3.4.1                                ...           6 years ago
  • 3.4.0                                ...           6 years ago
  • 3.3.4                                ...           6 years ago
  • 3.3.2                                ...           6 years ago
  • 3.3.1                                ...           6 years ago
  • 3.3.0                                ...           6 years ago
  • 3.2.5                                ...           7 years ago
  • 3.2.4                                ...           7 years ago
  • 3.2.3                                ...           7 years ago
  • 3.2.2                                ...           7 years ago
  • 3.2.1                                ...           7 years ago
  • 3.2.0                                ...           7 years ago
  • 3.1.0                                ...           7 years ago
  • 3.0.2                                ...           7 years ago
  • 3.0.1                                ...           7 years ago
  • 3.0.0                                ...           7 years ago
  • 2.7.0                                ...           7 years ago
  • 2.6.4                                ...           7 years ago
  • 2.6.3                                ...           7 years ago
  • 2.6.2                                ...           7 years ago
  • 2.6.1                                ...           7 years ago
  • 2.6.0                                ...           7 years ago
  • 2.5.0                                ...           7 years ago
  • 2.4.1                                ...           7 years ago
  • 2.4.0                                ...           7 years ago
  • 2.3.2                                ...           7 years ago
  • 2.3.1                                ...           7 years ago
  • 2.3.0                                ...           7 years ago
  • 2.2.0                                ...           7 years ago
  • 2.1.2                                ...           7 years ago
  • 2.1.1                                ...           7 years ago
  • 2.1.0                                ...           7 years ago
  • 2.0.0                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (12)
Dev Dependencies (18)

© 2010 - cnpmjs.org x YWFE | Home | YWFE