gh-repo-list

1.0.1 • Public • Published

gh-repo-list

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.

Package Sidebar

Install

npm i gh-repo-list

Weekly Downloads

2

Version

1.0.1

License

MIT

Last publish

Collaborators

  • hughsk