Opinionated linter for NPM package tarball and package.json metadata, enforcing strict standards beyond spec validity. Current stable version is v4.6.5, with regular monthly bugfix releases. Key differentiators: focuses on production-quality packaging (disallowed files, dependency checks, exports order) rather than code style, integrates as GitHub Action, and can lint directly from tarballs or stdin. Supports Node.js ^20.18 || >= 22.16. Commonly used in CI pipelines to enforce consistent publishing practices.
npm install npm-pkg-lintNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates programmatic usage: lint a tarball against its package.json, check validity, and exit with error if invalid.
Use ESM imports (import { npmPkgLint } from 'npm-pkg-lint') or stay on v2.x.Update your configuration to reference the new rule name.
Upgrade Node.js to ^20.18 or >=22.16.
Use '--pkgfile' as before; no immediate change needed, but prepare for removal in v5.
Ensure the full tarball is piped; use 'cat' or 'curl' with appropriate flags to stream fully.
For scoped packages like '@scope/pkg', use the exact full name without escaping: '--allow-dependency @scope/pkg'.
Rename the rule in your config and invert the boolean if needed.
Run 'npm install npm-pkg-lint' to add it as a dev dependency.
Add '\"type\": \"module\"' to your package.json or use .mjs extension.
Upgrade Node.js to ^20.18 or >=22.16.