(っᵔ◡ᵔ)っ ⭐
Ever wanted to download a single file or single folder from a Github repo?
git gimme unjs/giget/templates
git gimme unjs/giget/README.mdnpm install -g git-gimmeInstalled globally, git gimme works as a native git subcommand.
| Version | Highlights |
|---|---|
1.0.0 |
Download single files from GitHub without cloning entire repositories |
0.2.0 |
Exported function renamed to gitGimme; giget is now a peer dep |
0.1.0 |
Initial release — git gimme CLI, single-file + folder downloads |
Full history in CHANGELOG.md.
git gimme <source> [dest] [--ignore='pattern,pattern']
Lands as ./templates:
git gimme unjs/giget/templatesLands as ./README.md:
git gimme unjs/giget/README.mdIf the path could be either, git-gimme tries folder first and falls back to file.
Both /tree/ and /blob/ links work as they are:
git gimme https://github.com/unjs/giget/tree/main/templates
git gimme https://github.com/unjs/giget/blob/main/README.mdgit gimme 'unjs/giget/templates#v3.2.0'Without a #ref, the repository's actual default branch is used.
git gimme unjs/giget/templates ./vendor/templatesgit gimme unjs/giget ./giget --ignore='*.md,*.lock'import { gitGimme } from "git-gimme";
const { dir, files } = await gitGimme("unjs/giget/templates", {
dest: "./vendor/templates",
ignore: "*.md",
});
console.log(`${files} file(s) in ${dir}`);gitGimme(input, options?)
| Option | Type | Default | Description |
|---|---|---|---|
dest |
string |
repo or path's name | Where to write the file or folder. |
ignore |
string |
— | Comma-separated globs to skip. |
Returns { dir, files }: the resolved output path and how many files landed there.
Core downloading is done by giget — YAGNI 🧘♂️. Their page lists everything else that comes with it: private sources via --auth, GitLab / Bitbucket / Sourcehut,
offline cache.
As giget is a peer dependency so if already installed, this package simply enhances the DX.
bun install
bun run test
bun run typecheck
bun run build
bun run format