0.0.35 • Published 27 days ago

github-extractor v0.0.35

Weekly downloads
-
License
MIT
Repository
github
Last release
27 days ago

github-extractor

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. Also works on the cli.

Api Documentation

Quickstart

Install

npm install github-extractor

Usage

Initialize

import githubExtractor from "github-extractor";

const ghe = new githubExtractor({
    owner: "octocat",
    repo: "Spoon-Knife",
    // The default: Readme.md is a different file to README.md
    caseInsensitive: false, 
})

List

const fullList = await ghe.list();

// List a repo non recursively to only show the top-level items (recursive is true by default):
const topLevel = await ghe.list({ recursive: false }); 

// Show any conflicts that might arise if downloading to `dest`:
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.

// Save just `boo.jpg`:
await ghe.downloadTo({ dest: "some/path", selectedPaths: ["someFolder/boo.jpg"] });

// just the `README.md` file: 
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.

0.0.33

27 days ago

0.0.34

27 days ago

0.0.35

27 days ago

0.0.31

28 days ago

0.0.32

28 days ago

0.0.30

29 days ago

0.0.26

1 month ago

0.0.27

1 month ago

0.0.28

1 month ago

0.0.29

29 days ago

0.0.20

1 month ago

0.0.21

1 month ago

0.0.22

1 month ago

0.0.23

1 month ago

0.0.24

1 month ago

0.0.25

1 month ago

0.0.18

1 month ago

0.0.13

1 month ago

0.0.14

1 month ago

0.0.15

1 month ago

0.0.16

1 month ago

0.0.17

1 month ago

0.0.12

1 month ago

0.0.11

1 month ago

0.0.10

1 month ago

0.0.9

1 month ago

0.0.8

1 month ago

0.0.7

1 month ago

0.0.6

1 month ago