1.0.1 • Published 9 years ago

gh-repo-list v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

gh-repo-list

npm.io npm.io npm.io npm.io

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

Usage

NPM

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.