Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Finds available npm package names by checking registry availability, moniker collisions, and near-match typosquat risk for candidate names.
18% 82%+64 ptsof test cases passed
Passed 18 of 22 test cases with the skill, and 4 of 22 without it.
3 of 3 safety checks passed
13 agent runs
Authoritative reference for npm package-name validation, the moniker (similar-name) collision check, and the near-match typosquat layer this skill adds on top. Every rule here is grounded in published npm source, peer-reviewed research, or production tooling docs — see References.
This skill runs three checks (after syntactic validation). The first two are npm's own publish-time rules; the third is a typosquat warning the skill layers on top.
validate-npm-package-name and re-enforced by @npmcli/package-json's fixName step. Run client-side by the CLI and re-checked server-side. These cover length, allowed characters, leading char, casing, and a hard exclusion list. This skill uses the upstream package directly as a runtime dependency (bundled into the shipped check.mjs), not a hand-port — so the rules stay in sync with npm itself.npm publish of a new, unscoped package. The registry strips ., -, and _ and lowercases, then rejects the publish if the normalized name collides with an existing package. Introduced 26 December 2017 in response to the crossenv typosquatting incident. The npm CLI does not ship this check — there is no public npm API to test it client-side other than (a) attempting npm publish --dry-run against the live registry, or (b) reproducing the algorithm yourself and comparing against the registry's package list.extoolkit ~ es-toolkit, loadahs ~ lodash, typescirpt ~ typescript). Grounded in the TypoGard/SpellBound paper's empirical threshold (see § Near-match below).The moniker rule applies to new unscoped publishes only. Scoped names (@scope/name) and updates to packages you already own are not subject to it. The near-match layer applies regardless — even a scoped publish that's confusable with a popular unscoped name is worth warning about.
Source: npm/validate-npm-package-name/lib/index.js.
The validator returns two booleans plus arrays of errors and warnings:
| Field | Meaning |
|---|---|
validForNewPackages | errors.length === 0 && warnings.length === 0 — required for npm publish of a brand-new package. |
validForOldPackages | errors.length === 0 — minimum bar for existing packages already in the registry. |
| Condition | Exact error string |
|---|---|
name === null | name cannot be null |
name === undefined | name cannot be undefined |
typeof name !== 'string' | name must be a string |
name.length === 0 | name length must be greater than zero |
name.startsWith('.') | name cannot start with a period |
name.startsWith('-') | name cannot start with a hyphen |
/^_/.test(name) | name cannot start with an underscore |
name.trim() !== name | name cannot contain leading or trailing spaces |
name.toLowerCase() matches node_modules or favicon.ico | <excludedName> is not a valid package name |
encodeURIComponent(name) !== name (and not a valid scoped form) | name can only contain URL-friendly characters |
Next to this one in the catalogue, plus more from the same author.