List Npm Package Content

vercel's avatarfrom vercel
21.2kstars🔀3.7kforks📁View on GitHub🕐Updated Jan 1, 1970

When & Why to Use This Skill

This Claude skill enables developers to inspect and verify the exact contents of an npm package tarball before it is published to the registry. By simulating the bundling process, it provides a transparent view of which files are included or excluded based on package.json configurations, .npmignore, and .gitignore rules, helping to prevent publishing errors and security leaks.

Use Cases

  • Pre-publish Verification: Ensure all required build artifacts, such as distribution folders and type definitions, are correctly included in the bundle before running the final publish command.
  • Security & Privacy Auditing: Identify and remove sensitive files like local environment variables, internal documentation, or private scripts that might have been accidentally caught in the package glob.
  • Debugging Ignore Rules: Troubleshoot complex interactions between .npmignore and .gitignore to understand why specific files are missing from or unexpectedly present in the package.
  • Package Size Optimization: Analyze the included files to find and exclude unnecessary assets, such as test suites or source maps, to reduce the final install size for end-users.
namelist-npm-package-content
descriptionList the contents of an npm package tarball before publishing. Use when the user wants to see what files are included in an npm bundle, verify package contents, or debug npm publish issues.

List npm Package Content

This skill lists the exact contents of an npm package tarball - the same files that would be uploaded to npm and downloaded by users.

Usage

Run the script from the package directory (e.g., packages/ai):

bash scripts/list-package-files.sh

The script will build the package, create a tarball, list its contents, and clean up automatically.

Understanding Package Contents

The files included are determined by:

  1. files field in package.json - explicit allowlist of files/directories
  2. .npmignore - files to exclude (if present)
  3. .gitignore - used if no .npmignore exists
  4. Always included: package.json, README, LICENSE, CHANGELOG
  5. Always excluded: .git, node_modules, .npmrc, etc.
List Npm Package Content – AI Agent Skills | Claude Skills