CorefinityCorefinityDocs
Open the Control PanelControl Panel
Node.js · 2 of 7

Get a package from npm

Answers whether a package exists on the public npm registry, the version a selector resolves to, its licence, whether it has an install script and whether it is deprecated. exists is null when the registry could not be asked.

GET/api/corestack/node/packages/lookup

Query parameters

namestringRequired

The package's name on the npm registry, with its @scope/ when it has one. Lower case, at most 214 characters; not a URL, a git address, a file or a tarball.

selectorstring

A version, a range written without spaces or a tag, such as 0.34, ^1.90 or latest, at most 64 characters. Left out, the newest version is looked up.

Returns

200 What the registry says about the package.

Fields of the 200 answer
deprecatedstring or nullRequired

The deprecation notice, when the version is deprecated.

descriptionstring or nullRequired
existsboolean or nullRequired

Null when the registry could not be asked.

has_install_scriptboolean or nullRequired
lateststring or nullRequired
licencestring or nullRequired
resolved_versionstring or nullRequired

The version the selector resolves to now.

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403company_unavailableYour company is unavailable.
403scope_requiredUse a token with the scope named in scope.
403two_factor_requiredTurn on two-factor on your account, then send again.
404feature_offThis feature is not on for your organisation yet.
422invalid_argumentsThe arguments do not match the tool's input schema, or the Control Panel refused a field. Fix the fields named in the answer and call again.
422package_spec_invalidA package comes from the npm registry by name: no URL, git, GitHub, file, link, npm alias or workspace spec.
429rate_limitedWait for the seconds in Retry-After.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl 'https://manage.corefinity.com/api/corestack/node/packages/lookup?name=sharp' \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
{
  "deprecated": null,
  "description": "High performance image processing",
  "exists": true,
  "has_install_script": true,
  "latest": "0.34.4",
  "licence": "Apache-2.0",
  "resolved_version": "0.34.4"
}
Try it
Held in this tab's memory only. Never stored or sent to us.

Use a token with only the read scope. How to make one

Was this helpful?
Open in ClaudeOpen in ChatGPT