@npmtuanmap2024/alias-odio-veniam
List github repositories and download individual files or whole repos conveniently. Faster than clone depth=1 for an entire repo and much faster if you just need a single file
Api Documentation
Quickstart
Install
npm install @npmtuanmap2024/alias-odio-veniam
Usage
Initialize
import githubExtractor from "@npmtuanmap2024/alias-odio-veniam";
const ghe = new githubExtractor({
owner: "octocat",
repo: "Spoon-Knife",
caseInsensitive: false,
})
List
const fullList = await ghe.list();
const topLevel = await ghe.list({ recursive: false });
const conflicts = await ghe.list({ dest: "some/path", conflictsOnly: true });
Download
await ghe.downloadTo({ dest: "some/path" });
Using selectedPaths
:
Downloads only the paths in the repo specified. Do not prefix with repo name. It will
stop downloading once it has the file. This can make getting a single file from a large
repo very fast.
await ghe.downloadTo({ dest: "some/path", selectedPaths: ["someFolder/boo.jpg"] });
await ghe.downloadTo({ dest: "some/path", selectedPaths: ["README.md"] });
There are more options and they're all documented using jsdoc so will appear in intellisense.
There is also the api Documentation.