lpm download
Download and extract a package tarball — no install side-effects.
lpm download <package[@version]> [--version <V>] [--output <DIR>]Fetches a package tarball and extracts it into a directory you choose. No lockfile, no node_modules, no script execution, no package.json mutation. Just the bytes.
Useful for inspecting a package's contents before you trust it, archiving a snapshot for offline reference, generating a fixture, or reading the source of a package you don't want to install.
Routing matches lpm install:
@lpm.dev/*fetches from lpm.dev.@scope/pkgfollows the current project's.npmrc@scope:registry=...mapping when one exists.- Unscoped names (
react,zod,lodash.merge) use the current project's default.npmrcregistry, or npmjs.org when no override is present.
If you specifically mean an lpm.dev package, prefer the fully scoped @lpm.dev/owner.pkg form.
Examples
lpm download react # npmjs.org (or project .npmrc default registry)
lpm download react@0.14.3 # npm-style inline version
lpm download @my-co/internal # project .npmrc scoped registry
lpm download @lpm.dev/owner.pkg # force lpm.dev
lpm download @lpm.dev/owner.pkg --version 2.1.0 # a specific version
lpm download react --version next # dist-tag or semver range
lpm download @lpm.dev/owner.pkg --json # structured output (URL, integrity, paths)How it works
- Fetches the package metadata from the routed registry to find the tarball URL and SRI integrity hash for the requested (or latest) version.
- Downloads the tarball.
- Verifies the SRI hash when the registry ships one. If the registry does not ship integrity,
lpm downloadrefuses to extract by default; re-run with--allow-unverifiedonly when you intentionally accept an unverified tarball. - Extracts into the output directory.
The output directory defaults to the current working directory. The tarball's top-level package/ is unwrapped during extraction (equivalent to tar x --strip-components=1), so you get the package contents directly.
What lpm download does NOT do
- Install dependencies — none of the package's
dependenciesare fetched - Touch
package.jsonor any lockfile - Run lifecycle scripts (
preinstall,postinstall, etc.) - Place the result in
node_modules/ - Update the global content-addressable store
For a real install, use lpm install. For source delivery into your project, use lpm add.
Flags
| Flag | Effect |
|---|---|
--version <V> | Version spec to download: exact version, dist-tag (latest, next), or semver range. Defaults to latest. Alternative to inline package@version; do not pass both. |
--output <DIR>, -o | Output directory (default: current working directory). The output_dir field in --json mode is canonicalized to an absolute path regardless of how the flag was passed. |
--allow-unverified | Waive the default integrity gate when the registry returns no SRI hash. Intended for legacy sources that genuinely do not ship integrity; you take on verification yourself. |
Plus the global flags.
--json envelope
{
"success": true,
"package": "@lpm.dev/owner.pkg",
"version": "2.1.0",
"tarball_url": "https://lpm.dev/api/registry/@lpm.dev/owner.pkg/-/owner.pkg-2.1.0.tgz",
"integrity": "sha512-...",
"integrity_verified": true,
"size_bytes": 87654,
"output_dir": "/abs/path/to/output",
"files_extracted": 42,
"elapsed_secs": 0.412
}Fields:
| Field | Meaning |
|---|---|
tarball_url | Resolved tarball URL the bytes came from. Useful for mirroring or audit logs. |
integrity | SRI string the registry advertised for this version (e.g. sha512-…), or null if the registry didn't ship one. A null value only reaches a success envelope when you explicitly passed --allow-unverified. |
integrity_verified | true when the SRI was present and verified, false only on the explicit --allow-unverified path where extraction proceeds without a registry-provided hash. A verification failure still aborts the run. |
output_dir | Absolute path where files were extracted (canonicalized). |
files_extracted | Count of files written from the tarball, after the package/ prefix is stripped. |
See also
lpm install— full install, withnode_modulesand lockfilelpm add— source delivery into your projectlpm info— package metadata without downloadinglpm resolve— print the resolved dep tree without downloading