From 9f7834d963bce46493cbba50dfe3d8ab051b8eb2 Mon Sep 17 00:00:00 2001 From: reggi Date: Wed, 20 May 2026 14:29:44 -0400 Subject: [PATCH] fix(stage): key download --json output by package name `npm stage download --json` was emitting the package contents under a literal "undefined" key because `logTar` is called without a `key` option. Pass `pkgContents.name` so the JSON output is keyed by the package name, matching `npm publish --json` and `npm pack --json`. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- lib/commands/stage/download.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/commands/stage/download.js b/lib/commands/stage/download.js index 2451ff7727414..e5b7711aee54d 100644 --- a/lib/commands/stage/download.js +++ b/lib/commands/stage/download.js @@ -31,7 +31,7 @@ class StageDownload extends BaseCommand { const manifest = await this.#readManifestFromTarball(data) const pkgContents = await getContents(manifest, data) - logTar(pkgContents, { unicode, json }) + logTar(pkgContents, { unicode, json, key: pkgContents.name }) const safeName = pkgContents.name.replace('@', '').replace('/', '-') const filename = `${safeName}-${pkgContents.version}-${stageId}.tgz`