List Npm Package Content

作者 vercel5028fa46b4b4无许可证收录于 2026年10月8日更新于 2026年10月8日

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.

AI 生成的概览

在发布前列出 npm 包 tarball 中的文件,用于核对打包内容。

功能
该技能检查 npm 包 tarball,并列出将上传到 npm、供用户下载的确切文件。它附带一个 shell 脚本,会构建包、生成 tarball、列出其内容并自动清理。它还说明哪些文件会被包含,依据是 package.json 的 files 字段、.npmignore、.gitignore 以及 npm 默认始终包含和始终排除的规则。
适用场景
当用户想查看 npm 包中包含哪些文件、在发布前核对包内容,或排查 npm publish 问题时使用。
运行要求
需要具备 bash、npm 和 Node.js 工具的 shell 环境,用于构建包并生成 tarball。它附带可执行脚本 scripts/list-package-files.sh,需在包目录中运行。

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
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.

来源与署名

来源:vercel/ai位于skills/list-npm-package-content提交5028fa4

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架