Skip to content
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.

Latest commit

 

History

History
52 lines (36 loc) · 1.15 KB

README.md

File metadata and controls

52 lines (36 loc) · 1.15 KB

🐙 Down Git

NPM version

Download directory or file from GitHub.

Install

npm i down-git
# yarn add down-git
# pnpm add down-git

Usage

The following command downloads the directory https://github.com/holazz/down-git/tree/main/src into the ./tmp folder

down-git holazz/down-git/src -b main -o ./tmp

Use down-git --help for more information

You can also use it programmatically:

import { download } from 'down-git'

const options = {
  route: 'holazz/down-git/src',
  branch: 'main',
  output: './tmp',
}

download(options).then(
  () => console.log('Done!')
)

Options

name required description default
route true Directory or file path (owner/repo/path) -
branch false The name of the commit/branch/tag Repository's default branch (usually main or master)
output false Output directory process.cwd()
token false Personal access token -

License

MIT License © 2022 zz