Skip to content

IonicaBizau/gh-repos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Feb 28, 2016
fbcfe66 · Feb 28, 2016

History

2 Commits
Feb 28, 2016
Feb 28, 2016
Feb 28, 2016
Feb 28, 2016
Feb 28, 2016
Feb 28, 2016
Feb 28, 2016

Repository files navigation

gh-repos PayPal Version Downloads Get help on Codementor

Get one or all the owner repositories from GitHub.

Installation

$ npm i --save gh-repos

Example

const githubRepos = require("gh-repos");

// Get a specific repository (the result will be an array containing one element)
githubRepos("IonicaBizau/git-stats", function (err, repos) {
    console.log(err || repos);
    // [ { id: 30538630,
    //     name: 'git-stats',
    //     full_name: 'IonicaBizau/git-stats',
    //     owner: { login: 'IonicaBizau', ...},
    //     private: false,
    //     ...
    //     subscribers_count: 52 } ]
});

// Get all my repositories
githubRepos("IonicaBizau", function (err, repos) {
    console.log(err || repos);
    // [ { id: 20149013,
    //     name: '3x3-equation-solver',
    //     full_name: 'IonicaBizau/3x3-equation-solver',
    //     owner: {...},
    //     ...
    //     default_branch: 'master' },
    //   { id: 48318047,
    //     name: 'add-subtract-date',
    //     full_name: 'IonicaBizau/add-subtract-date',
    //     owner: {...},
    //     ...
    //     default_branch: 'master' },
    //   ...
    //   { id: 21358670,
    //     name: 'youtube-topmost',
    //     full_name: 'IonicaBizau/youtube-topmost',
    //     owner: {...},
    //     ...
    //     default_branch: 'master' } ]
});

// Use a token
githubRepos("IonicaBizau", "your token", function (err, repos) {
    // ...
});

Documentation

ghRepos(input, token, cb)

Get one or all the owner repositories from GitHub.

Params

  • String input: The GitHub owner or repository full name (owner/repo).
  • String token: An optional GitHub token.
  • Function cb: The callback function.

How to contribute

Have an idea? Found a bug? See how to contribute.

Where is this library used?

If you are using this library in one of your projects, add it in this list. ✨

License

MIT © Ionică Bizău