Skip to main content
Wright Websites

pkg-field-gauge

validate package.json fields

Validate package.json before you publish: exports/main/types/bin consistency and condition order, targets that do not exist or are not in "files", ESM/CJS mismatches, name/version rules, repository.

  • 43/week on npm
  • 2★
  • MIT
  • v1.1.0
  • Developer Tooling
npx pkg-field-gauge

Read the full README on GitHub (opens in a new tab)View on npm (opens in a new tab)

pkg-field-gauge

From the README

A package can pass its tests and still ship broken. The types condition sits after import, so TypeScript never sees it. require points at an ESM file. main and exports["."] load different files. The .d.ts isn't covered by files. sideEffects: false lets bundlers drop your CSS. The repository doesn't match the git remote, so provenance publishing fails. pkg-field-gauge resolves every entry point on disk and checks each field the way Node, TypeScript, bundlers and npm read it. Every finding has a line number and a concrete fix.

pkg-field-gauge --pack                 # lint what npm would publish (npm pack --dry-run)
pkg-field-gauge -f html > report.html  # self-contained HTML report

Related packages

Developer Tooling