npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cus/semantic-release-npm

v0.0.0-development

Published

Set of semantic-release plugins to publish to a npm registry

Downloads

1

Readme

@semantic-release/npm

Set of semantic-release plugins for publishing to a npm registry.

Travis Codecov Greenkeeper badge

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.

getLastRelease

Determine the last release of the package on the npm registry.

publish

Update the package.json version, create the npm package tarball and publish to the npm registry.

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 at this point.

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. | true | | 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.

Npm configuration

The plugins are based on npm and will use 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"
  }
}

Usage

The plugins are used by default by semantic-release so no specific configuration is requiered to use them.

Each individual plugin can be disabled, replaced or used with other plugins in the package.json:

{
  "release": {
    "verifyConditions": ["@semantic-release/npm", "verify-other-condition"],
    "getLastRelease": "custom-get-last-release",
    "publish": ["@semantic-release/npm", "custom-publish"]
  }
}

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

{
  "release": {
    "verifyConditions": ["@semantic-release/npm", "@semantic-release/git", "@semantic-release/github"],
    "getLastRelease": "@semantic-release/git",
    "publish": [
      {
        "path": "@semantic-release/npm",
        "npmPublish": false,
        "tarballDir": "dist"
      },
      {
        "path": "@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 git plugin:

{
  "release": {
    "verifyConditions": ["@semantic-release/npm", "@semantic-release/git"],
    "getLastRelease": "@semantic-release/npm",
    "publish": [
      {
        "path": "@semantic-release/npm",
        "pkgRoot": "dist"
      },
      {
        "path": "@semantic-release/git",
        "assets": ["package.json", "npm-shrinkwrap.json"]
      },
    ]
  },
  "scripts": {
    "postpublish": "cp -r dist/package.json . && cp -r dist/npm-shrinkwrap.json ."
  }
}