# github-directory-downloader

> Download just a sub directory from a GitHub repo

Latest version **1.3.6** (published 2021-02-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install github-directory-downloader
pnpm add github-directory-downloader
yarn add github-directory-downloader
bun add github-directory-downloader
```

Provides the command `github-directory-downloader`.

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.6 |
| Published | 2021-02-22 |
| First published | 2020-12-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 42 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | eilrix |
| Maintainers | elrix |
| Keywords | github, download, directory |

## Links

- npm: https://www.npmjs.com/package/github-directory-downloader
- Repository: https://github.com/eilrix/github-directory-downloader
- Issues: https://github.com/eilrix/github-directory-downloader/issues
- npm.io page: https://npm.io/package/github-directory-downloader

## Dependencies (3)

- [fs-extra](https://npm.io/package/fs-extra.md) ^9.0.1
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.1
- [yargs-parser](https://npm.io/package/yargs-parser.md) ^20.2.4

## Recent versions

- 1.3.6 (latest) — 2021-02-22
- 1.3.5 — 2021-01-02
- 1.3.4 — 2021-01-02
- 1.3.3 — 2021-01-02
- 1.3.2 — 2021-01-02
- 1.3.1 — 2021-01-02
- 1.3.0 — 2021-01-02
- 1.2.4 — 2021-01-01
- 1.2.3 — 2021-01-01
- 1.2.2 — 2020-12-31
- 1.2.1 — 2020-12-31
- 1.2.0 — 2020-12-31
- 1.1.1 — 2020-12-31
- 1.1.0 — 2020-12-31
- 1.0.0 — 2020-12-31

## README

# github-directory-downloader

Download just a sub directory from a GitHub repo

Node.js port for [`download-directory.github.io`](https://github.com/download-directory/download-directory.github.io)

Recursively (with subdirectories) downloads files only from specified directory via https://raw.githubusercontent.com/
 

```sh
npm i github-directory-downloader
```

## Usage

#### CLI
```sh
github-directory-downloader https://github.com/mrdoob/three.js/tree/dev/docs/manual --dir=temp --token=******
```
#### Programmatic

```typescript
import download from 'github-directory-downloader';
import { resolve } from 'path';

// Will download content inside docs/manual into "../temp" 
// and return statistics for downloaded files
const stats = await download(
    'https://github.com/mrdoob/three.js/tree/dev/docs/manual',
    resolve(__dirname, '../temp')
);
```

You can also pass options as a third argument:
```typescript
{
    /** GitHub API token */
    token?: string;

    /** Max number of async requests at the same time. 10 by default.
     * download-directory.github.io has no limit, but it can lead to IP blocking
     */
    requests?: number;

    /** Disable console logs */
    muteLog?: boolean;
}
```

---
_Source: https://npm.io/package/github-directory-downloader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
