Reference · Tools

Npm

Consume the NPM registry API to search for packages, retrieve package metadata and versions, and manage distribution tags.

Action Development v1

The Npm node talks to an npm registry: searching for packages, retrieving metadata and version lists, and managing distribution tags. A typical build is watching for new versions of a dependency you rely on and opening a ticket when one is published.

Node type
Action
Parameters
12
Outputs
Output, Error
Credentials
Npm API

Npm

Search packages, get metadata/versions, and manage dist-tags on npm registries.

Overview

NPM (Node Package Manager) is the default package manager for Node.js. This tool interacts with npm-compatible registries (npmjs.org, GitHub Packages, Verdaccio, Artifactory, etc.) via their HTTP API. It supports two resources: Package (get metadata at a specific version, get all versions, search packages) and Distribution Tag (get all dist-tags, update a dist-tag). Authentication is optional — only required for write operations (dist-tag update) or private registry access. The credential provides an access token and a configurable registry URL (defaults to https://registry.npmjs.org).

Category: Development
Tool Name: npm
Version: 1

Appearance: Icon: si-npm | Color: #CB3837

Node Type

Action — processes input items and produces output

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires Npm API credentials. See the Credentials Guide for setup instructions.

Resources

ResourceValue
Packagepackage
Distribution TagdistTag

Operations

Package

OperationValueDescription
Get MetadatagetMetadataReturns all the metadata for a package at a specific version
Get VersionsgetVersionsReturns all the versions for a package
SearchsearchSearch for packages

Distribution Tag

OperationValueDescription
Get AllgetManyReturns all the dist-tags for a package
UpdateupdateUpdate a dist-tag for a package

Parameters

Package: Get Metadata

ParameterTypeRequiredDefaultDescription
Package NamestringYesThe name of the npm package. Supports scoped packages (e.g., @scope/package). Supports expressions like {{ $json.packageName }}.
Package VersionstringYeslatestThe version of the package to retrieve metadata for. Can be a semver version (e.g., 1.2.3) or a dist-tag (e.g., latest, next). Supports expressions.

Package: Get Versions

ParameterTypeRequiredDefaultDescription
Package NamestringYesThe name of the npm package. Supports scoped packages (e.g., @scope/package). Supports expressions like {{ $json.packageName }}.
ParameterTypeRequiredDefaultDescription
QuerystringYesThe query text used to search for packages. Supports expressions.
LimitnumberNo10Max number of results to return. Supports expressions.
OffsetnumberNo0Offset to return results from (for pagination). Supports expressions.

Distribution Tag: Get All

ParameterTypeRequiredDefaultDescription
Package NamestringYesThe name of the npm package. Supports scoped packages (e.g., @scope/package). Supports expressions like {{ $json.packageName }}.

Distribution Tag: Update

ParameterTypeRequiredDefaultDescription
Package NamestringYesThe name of the npm package. Supports scoped packages (e.g., @scope/package). Supports expressions like {{ $json.packageName }}.
Package VersionstringYesThe version string to point the distribution tag to (e.g., 1.2.3). Supports expressions.
Distribution Tag NamestringYeslatestThe name of the distribution tag to update (e.g., latest, next, beta). Supports expressions.

All Operations

ParameterTypeRequiredDefaultDescription
Max ConcurrencynumberNo10Maximum number of items to process concurrently.

Output Data

The registry response is merged onto the input item JSON — the fields already on the item pass through and the result is written on top of them. Binary data is forwarded unchanged.

OperationOutput items per input item
package / getMetadataOne item carrying the full registry metadata document for that version
package / getVersionsFans out — one item per published version, each { version, published_at }, newest first
package / searchFans out — one item per match, each { name, version, description }
distTag / getManyOne item whose properties are the dist-tag names mapped to versions
distTag / updateOne item carrying the registry’s response to the tag update

getVersions and search return a trimmed shape rather than the raw registry payload: version listings are filtered to valid semver entries and sorted by publish date, and search results are reduced to name, version and description. If an operation produces no results at all, the input item still passes through as a single output item with nothing added.

Reference the result downstream by expression, e.g. {{ $json.version }}.

Usage Examples

  • Get metadata for an npm package at a specific version
  • List all published versions of an npm package
  • Search the npm registry for packages matching a query
  • Get all distribution tags for an npm package
  • Update a distribution tag to point to a new version

Example Configuration

Fetch the metadata document for a package at a given version:

{
  "type": "npm",
  "parameters": {
    "resource": "package",
    "operation": "getMetadata",
    "packageName": "{{ $json.packageName }}",
    "packageVersion": "latest"
  }
}

List every published version of a scoped package:

{
  "type": "npm",
  "parameters": {
    "resource": "package",
    "operation": "getVersions",
    "packageName": "@typescript-eslint/parser"
  }
}

Search the registry with pagination:

{
  "type": "npm",
  "parameters": {
    "resource": "package",
    "operation": "search",
    "query": "workflow automation",
    "limit": 50,
    "offset": 0
  }
}

Read the current dist-tags for a package:

{
  "type": "npm",
  "parameters": {
    "resource": "distTag",
    "operation": "getMany",
    "packageName": "express"
  }
}

Point a dist-tag at a newly published version:

{
  "type": "npm",
  "parameters": {
    "resource": "distTag",
    "operation": "update",
    "packageName": "{{ $json.packageName }}",
    "distTagName": "beta",
    "packageVersion": "{{ $json.newVersion }}"
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

Query npm registries to search packages, get metadata/versions, and manage distribution tags.

Frequently asked questions

Can it work against a private registry?

It consumes the npm registry API, so it works wherever that API is exposed and the credential you supply has access.

What are distribution tags used for?

They are the named pointers such as `latest` or `beta` that decide what an install without a version resolves to. Managing them is how a release gets promoted.

What metadata can I retrieve?

Package metadata and version information — enough to compare what is published against what you have deployed.

Which credential does it need?

An Npm API credential, which matters for private packages and for tag management.

Build with the Npm node

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need Npm API credentials first.

Open BusyBot

Last updated . Spotted something wrong? Tell us.