Skip to content

Repository script API / publish-tool-packages / getNpmRegistryIntegrity

Function: getNpmRegistryIntegrity() ​

getNpmRegistryIntegrity(packageName, version, fetchImpl?): Promise<string | null>

Defined in: publish-tool-packages.mjs:248

Reads the integrity of one exact public npm version from its package document.

Parameters ​

packageName ​

string

npm package name, including its scope when present.

version ​

string

Exact semantic version to query.

fetchImpl? ​

{(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Fetch implementation used for the registry request.

Returns ​

Promise<string | null>

Registry integrity, or null when the existing package does not list the version.

Throws ​

When the package is missing, or the registry is unavailable or returns a malformed response.

pumpkin-plugins documentation