@any-u/git-downloader
v0.0.8
Published
Download a github repository from node
Downloads
22
Readme
git-downloader
Download a github repository from node.
Installation
npm install @any-u/git-downloader
Usage
import download from "@any-u/git-download"
import path from "path"
download({
url: "https://github.com/vuejs/core/tree/main/packages/reactivity",
dest: path.resolve(__dirname, "./"),
token: "<Github-Token>",
})
// OR
download({
url: "https://github.com/vuejs/core/blob/main/packages/reactivity/src/reactive.ts",
token: "<Github-Token>",
})
API
download(options, processPathFn, processContentFn)
options
Options for downloading GitHub repository.processPathFn
Function for processing pathprocessContentFn
Function for processing file content
Returns: Promise<void>
Options
The following properties are available on the options
object:
url
Type:string
A string representing the URL for downloading GitHub repository.dest
Type:string
Default:process.cwd()
The file path to download the repository to.token
Type:string
A GitHub personal token, get one here: https://github.com/settings/tokens