gh-repo-list

Stream a list of all repositories for either a particular user/organisation or all of GitHub

OTHER License

Downloads
12
Stars
6

gh-repo-list

Stream a list of all repositories for either a particular user/organisation or all of GitHub.

Usage

All methods have a token argument for making authenticated requests with. If you'd like to make unauthenticated requests, use null here instead.

stream = list.user(token, name)

Returns an object stream listing all repositories owned by user name.

stream = list.org(token, name)

Returns an object stream listing all repositories owned by organisation name.

stream = list.all(token)

Returns an object stream listing all public repositories on GitHub ever.

Example

var list = require('gh-repo-list')
var auth = require('ghauth')

auth({
    configName: 'gh-repo-list'
  , scopes: ['user', 'repo']
}, function(err, authData) {
  if (err) throw err

  var stream = list.user(authData.token, 'mikolalysenko')

  stream.on('data', function(repo) {
    console.log(repo.full_name)
  })

  stream.on('end', function() {
    console.log('done!')
  })
})

License

MIT. See LICENSE.md for details.