https://github.com/ragingwind/cache-github-repo
Download files of the github repository at the local cache by managing commit tracing
https://github.com/ragingwind/cache-github-repo
Last synced: 9 months ago
JSON representation
Download files of the github repository at the local cache by managing commit tracing
- Host: GitHub
- URL: https://github.com/ragingwind/cache-github-repo
- Owner: ragingwind
- License: mit
- Created: 2017-08-09T11:25:57.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-10T04:39:40.000Z (almost 9 years ago)
- Last Synced: 2025-02-13T12:16:52.048Z (over 1 year ago)
- Language: TypeScript
- Size: 45.9 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# cache-github-repo [](https://travis-ci.org/ragingwind/cache-github-repo)
> Download files of the github repository at the local cache by managing commit tracing
## Install
```
$ npm install cache-github-repo
```
## Usage
```js
const CacheGithubRepo = require('cache-github-repo');
const cache = new CacheGithubRepo()
if (await cache.updatable(repo, './node_modules/')) {
await cache.cache('zeit/next.js', path.join('dest'))
}
```
## API
### CacheGithubRepo()
It returns the instance of cache manager
#### updatable
Check the repo can be updated, is out of dated
##### repo
Type: `string`
Repository names on github. ex) `ragingwind/cache-github-repo`
##### cachePath
Type: `string`
Path for saving of cache manifest file, named by `cache-github-repo.json`. Default is parent's `node_module/.cache`
#### cache
Cache the repo to local
##### repo
Type: `string`
Repository names on github. ex) `ragingwind/cache-github-repo`
##### dest
Type: `string`
unzipped files after downloading
## License
MIT © [Jimmy Moon](http://ragingwind.me)