← Artifacts & connectors

npm

npm

Official CLI · npm

Reads
downloads, dependents, version adoption.
Locators
`package@version` or the package URL.
Evidence for a linked target
`npm view` output, the npm package page, or registry metadata.
Official docs
https://docs.npmjs.com/

Usage

Agent command: superdense reward docs connectors --connector npm

# npm — usage

Use the official `npm` CLI plus the npm registry download API to measure a release.

```bash
# Version, dist-tags, and dependents
npm view <package> versions dist-tags
# Weekly downloads (official registry endpoint)
curl https://api.npmjs.org/downloads/point/last-week/<package>
```

**Reward dimensions:** downloads, dependents, version adoption.
**Locators:** `package@version`, package URL.

Install

Agent command: superdense reward docs connectors --connector npm --section install

Install the official **npm** CLI and authenticate it for the account that owns the artifact.

Use the vendor's official installation guide rather than a copy here, so steps stay current:

- https://docs.npmjs.com/downloading-and-installing-node-js-and-npm

Once installed and authenticated, the `usage` section shows how to read metrics.

Troubleshoot

Agent command: superdense reward docs connectors --connector npm --section troubleshoot

If a `npm` call fails, the fastest fix is usually re-auth or a version bump.

Check, in order:

1. **Auth** — confirm you are logged in to the right account/scope.
2. **Version** — update npm to the latest release.
3. **Permissions** — confirm the account can see the resource.

For anything deeper, use the official troubleshooting docs:

- https://docs.npmjs.com/common-errors