3.1.0 • Published 9 years ago

github-getter v3.1.0

Weekly downloads
1
License
ISC
Repository
github
Last release
9 years ago

codecov.io travis-ci.org codecov.io

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 } = require('./src/')(process.env.ghtoken)

const logContent = (err, res) => {
  if (err) throw err
  console.log(res.content)
}

file({ repoName: 'des-des/github-getter', filePath: 'README.md' }, logContent)

repo({ repoName: 'des-des/github-getter' }, (err, githubGetter) => {
  if (err) throw err
  githubGetter['README.md'](logContent)
})

user({ name: 'des-des' }, (err, desdes) => {
  if (err) throw err
  desdes['github-getter']((err, githubGetter) => {
    if (err) throw err
    githubGetter['README.md'](logContent)
  })
})

Documentation

  • init - token => githubGetter, where
    • token - github api token.
  • githubGetter - object with
    • file - ({ repoName, filePath }, cb) => {}, where
      • repoName - name of the repository,
      • filePath - path of desired file, ie assets/someData.json,
      • cb - (err, githubFile) => {}.
    • repo - ({ repoName }, cb) => {}, where
      • repoName - name of the repository,
      • cb - (err, githubRepo) => {}.
    • user - ({ name }, cb) => {}, where
      • name - github user name,
      • cb - (err, githubUser) => {}.
    • org - ({ name }, cb) => {}, where
      • name - github org name,
      • cb - (err, githubUser) => {}.
  • githubFile - object containing
    • content - 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) => {}.
3.1.0

9 years ago

3.0.1

9 years ago

3.0.0

9 years ago

2.0.0

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago