← 返回命令列表

Linux command

bun-pm-pack 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Pack the current package

bun pm pack

Pack without writing

bun pm pack --dry-run

Pack to a specific directory

bun pm pack --destination [path/to/dir]

Pack with a custom filename

bun pm pack --filename [package.tgz]

Pack with minimal output

bun pm pack --quiet

说明

bun pm pack creates a compressed .tgz archive containing all files that would be published to npm, following the same inclusion and exclusion rules as npm pack. This is useful for inspecting what will be published before running bun publish, testing local packages, or sharing packages without a registry. The command respects the files field in package.json, .npmignore, and .gitignore when determining which files to include.

参数

--dry-run
Perform all tasks except writing the tarball to disk.
--destination _dir_
Specify an output directory for the tarball. Cannot be combined with --filename.
--filename _name_
Set the exact filename for the tarball. Cannot be combined with --destination.
--ignore-scripts
Skip running prepack, postpack, and prepare scripts.
--gzip-level _0-9_
Set gzip compression level. Default is 9 (maximum compression).
--quiet
Only output the tarball filename, suppressing verbose output.

FAQ

What is the bun-pm-pack command used for?

bun pm pack creates a compressed .tgz archive containing all files that would be published to npm, following the same inclusion and exclusion rules as npm pack. This is useful for inspecting what will be published before running bun publish, testing local packages, or sharing packages without a registry. The command respects the files field in package.json, .npmignore, and .gitignore when determining which files to include.

How do I run a basic bun-pm-pack example?

Run `bun pm pack` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --dry-run do in bun-pm-pack?

Perform all tasks except writing the tarball to disk.