List Npm Package Content
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.
| name | list-npm-package-content |
|---|---|
| description | List 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:
filesfield inpackage.json- explicit allowlist of files/directories.npmignore- files to exclude (if present).gitignore- used if no.npmignoreexists- Always included:
package.json,README,LICENSE,CHANGELOG - Always excluded:
.git,node_modules,.npmrc, etc.