webhooks coming soon (so you gh hosted content can tell you site when to update!)
github-getter
What?
A quick and easy way to get files from github
github-getter is a small module to take the hassle out of downloading files from github. Download specific files, or specify repositories/users and recieve lists of files/repositories available.
Why?
Save time digging around docs / fiddling with with headers.
How?
get a github api token. Create a personal one here or use oauth.
node 6
const user repo file = processenvghtoken const logContent = { if err throw err console}
Documentation
init
-token => githubGetter
, wheretoken
- github api token.
githubGetter
- object withfile
-({ repoName, filePath }, cb) => {}
, whererepoName
- name of the repository,filePath
- path of desired file, ieassets/someData.json
,cb
-(err, githubFile) => {}
.
repo
-({ repoName }, cb) => {}
, whererepoName
- name of the repository,cb
-(err, githubRepo) => {}
.
user
-({ name }, cb) => {}
, wherename
- github user name,cb
-(err, githubUser) => {}
.
org
-({ name }, cb) => {}
, wherename
- github org name,cb
-(err, githubUser) => {}
.
githubFile
- object containingcontent
- string containing file content
- githubRepo - an object were keys are paths to repos files:
[filepath]
-cb(err, githubFile) => {}
.
- githubUser - an object were keys are repo names belonging to the user/org:
[repoName]
-cb(err, githubRepo) => {}
.