Skip to content

Repository script API / publish-tool-packages / npmDistTag

Function: npmDistTag() ​

npmDistTag(version, latestVersion): "latest" | "backfill"

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

Picks the npm dist-tag for a release so that publishing an older version leaves latest alone.

Parameters ​

version ​

string

Version being published.

latestVersion ​

string | undefined

The registry's current latest dist-tag, if any.

Returns ​

"latest" | "backfill"

latest for a version above the current latest, otherwise backfill.

Throws ​

When the version is a prerelease, which the automated publisher does not tag.

pumpkin-plugins documentation