packall
Reference

Options

Every flag, grouped the way --help groups them.

packall [flags] <spec...>

Everything below is also available as packall --help, and as controls in the browser runner — all three are read from the same declaration, so they cannot describe different tools.

Specs

A spec is a package name with an optional selector, exactly as npm install takes it:

SpecResolves to
lodashthe latest published version
react@19.2.8that exact version
@babel/core@^7the best match for the range
typescript@nextwhatever the dist-tag points at

Quote anything with a ^ or a leading @. PowerShell reads a bare @ as an operator, so packall @babel/core is a parse error there.

Specs can come from a file instead — see Bundle from a file.

Input

Where the list of packages comes from.

--file, -f PATH
Read specs from a file: a package.json (bundles its dependencies), a lockfile (bundles the versions it pins), or one spec per line with # and // comments. Detected by content, not extension
--prod

Requires --file

With --file <package.json>, skip devDependencies (default: false)
--lockfile MODE
With --file <package.json>: detect finds a sibling lockfile (default) · off never does · npm, pnpm or bun requires that one · or pass a path (default: detect)

Output

Where bundles are written and what shape they take. --layout is the one most runs care about; see Output layouts.

--out, -o DIR
Directory to write bundles into (default: the current directory) (default: .)
--layout
per-spec: one tarball per package (default) · single: one deduplicated tarball · dir: unpacked tree · flat: one directory of tarballs, no nesting (per-spec · single · dir · flat)
--layout-threshold N
Switch to --layout single above N archives, or at 2x duplication, without asking. Omit to be asked instead at 20; pass 0 to neither ask nor switch
--archive-name NAME

Requires --layout single

Base name for the archive in --layout single
--force
Replace any existing output file. --no-force refuses instead. Omit to be asked per file
--force-spec SPEC
Always replace these specs, whatever --force says about the rest, e.g. --force-spec tsdown esbuild@0.21.5
--print-absolute-path
Report full paths instead of ones relative to the current directory (default: false)
--json
Emit a machine-readable summary on stdout (default: false)

Selection

Which versions and which platforms end up in the closure. The defaults are chosen so the bundle installs on a machine that is not yours — see Versions and platforms for why.

--all-versions
Bundle every published version matching a range, not just the best match (default: false)
--max-versions N

Requires --all-versions true

With --all-versions, keep at most the N newest matching versions
--include-prerelease
Let prereleases satisfy ranges (default: false)
--optional
Follow optionalDependencies. On by default — this is where per-platform native binaries live (default: true)
--peer
Follow non-optional peerDependencies (default: true)
--platform LIST
Restrict optional deps to these platforms. An OS alone takes every arch: win32,linux · linux-x64 · linux-x64-musl (default: all)

Registry

Where packages are fetched from, and how patiently. See Private registries.

--registry, -r URL
Registry to fetch from. Outranks every other source, including npm_config_registry (default: your .npmrc)
--npmrc PATH
Explicit .npmrc to read registries and credentials from. npm_config_registry in the environment still outranks its registry= line
--rewrite-tarball-host
Fetch tarballs from --registry rather than the URL the registry returned (default: false)
--timeout MS
Ceiling on every network wait: connecting, the preflight check, and each request. Prevents an unreachable registry hanging the run (default: 10000)
--retries N
Retries for transient failures (5xx, 429, dropped connections) (default: 3)
--concurrency, -c N
Simultaneous registry requests (default: 10)

Other

--dry-run
Resolve and report what would be bundled, downloading nothing (default: false)
--verify
Check every tarball against the registry's checksum (default: true)
--quiet, -q
Only report warnings and errors (default: false)
--interactive, -i
Choose from what the resolution actually found — platforms, layout — instead of guessing flags up front (default: false)
--yes, -y
Never prompt; take the default for any question (default: false)

Global flags

Flag
--help, -hShow help and exit 0.
--version, -vShow the version and exit 0.
--wizardBuild the command through prompts.
--completions <bash|zsh|fish|sh>Print a shell completion script.
--log-level <level>Minimum log level.

Exit codes

0 on success, including a dry run that wrote nothing. 1 on any failure — a bad flag, an unreachable registry, a package that does not exist, an integrity mismatch, or a refused overwrite.

On this page