https://github.com/sodiray/octokit-downloader
https://github.com/sodiray/octokit-downloader
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sodiray/octokit-downloader
- Owner: sodiray
- Created: 2022-01-06T06:37:46.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-09T05:16:06.000Z (over 3 years ago)
- Last Synced: 2025-01-30T05:27:21.748Z (8 months ago)
- Language: TypeScript
- Size: 58.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Octokit Downloader
> Little utility to easily download a GitHub repository by owner/name/branch and unzip it in a location of your choosing
*NOTE:* Only works with public repositories
## Install
```
yarn add octokit-downloader
```## Usage
```ts
import downloader from 'octokit-downloader'// Download a repository by link to
// a local directory and unzip it to
// the given name
await downloader.download({
from: 'https://github.com/exobase-inc/aws-cloud-build-trigger-bridge',
to: `${__dirname}/repo.zip`,
unzip: true // Unzipped as 'repo' directory
})// Download a repository by owner
// repo and branch and don't unzip
// it.
await downloader.download({
from: {
owner: 'exobase-inc',
repo: 'aws-cloud-build-trigger-bridge',
branch: 'master'
}
to: `${__dirname}/repo.zip`,
unzip: false
})// Want to do the downloading yourself?
// you can just ask for the link given
// the same `from` arg
const downloadLink = downloader.link({
from: 'https://github.com/exobase-inc/aws-cloud-build-trigger-bridge',
// or from: { owner, repo, branch }
})```