Skip to content

feat: support downloading files without extraction - #5

Merged
ovr merged 2 commits into
masterfrom
download-files-without-unpacking
Sep 21, 2026
Merged

ovr merged 2 commits into
masterfrom
download-files-without-unpacking

Conversation

@ovr

@ovr ovr commented Sep 21, 2026

Copy link
Copy Markdown
Member

Adds support for downloading plain files (a .jar, a .node, a bare binary) instead of always trying to unpack them, which currently fails with Unable to detect archive format from its contents.

Whether a file is an archive is now detected from the mime type of the resolved url via mime-types — gzip, tar and zip are extracted, everything else is downloaded as is; a new dst option sets the destination path (subdirectories are created, escaping the package directory is rejected) and extract overrides the detection.

Along the way urls are parsed with node's URL instead of regexps and split, which also lifts the old [a-z-]+ limit on owner/repo in the github_artifact:// protocol, and the constraints check moved before url resolution so filtered-out platforms no longer hit the GitHub API.

Documented in the README and covered end-to-end in CI: example/ now downloads a plain file and the workflow asserts it landed on disk.

🤖 Generated with Claude Code

ovr and others added 2 commits September 21, 2026 13:52
Extraction is now detected from the mime type of the resolved url via
mime-types: gzip, tar and zip are extracted, anything else (a .jar, a
.node, a bare binary) is downloaded as is. A new "dst" option sets the
destination path for such files, and "extract" overrides the detection.

Also parse urls with node's URL instead of regexps/string splitting,
which additionally allows uppercase and underscores in owner/repo of
the github_artifact protocol.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The resolving logic moves into src/resolve.ts so it can be imported
without running the installer, which reads package.json from cwd at
module load. src/index.ts keeps the cli loop; resolveSimplePath and
resolveDst now take the package version and cwd as arguments instead of
reaching for module state.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ovr
ovr force-pushed the download-files-without-unpacking branch from d49d640 to a53cfc8 Compare September 21, 2026 11:52
@ovr
ovr merged commit 70f3fd2 into master Sep 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant