Skip to content

Instantly share code, notes, and snippets.

@alundiak
Last active April 27, 2022 21:44
Show Gist options
  • Save alundiak/295309a8aab3cc58701804ab1e5b0f29 to your computer and use it in GitHub Desktop.
Save alundiak/295309a8aab3cc58701804ab1e5b0f29 to your computer and use it in GitHub Desktop.
export default function getInfo(TOKEN, myArrayOfRepositories) {
// let gh = new GitHub(); // unauthenticated client. Can even be used to create a anonymous gist for example
/*
// basic auth. The same as unauthenticated, this approach is limited to GET/POST requests per day.
let gh = new GitHub({
username: 'your-user',
password: 'TBD',
});
*/
// But with TOKEN provided no limits.
let gh = new GitHub({
token: TOKEN
});
myArrayOfRepositories.forEach(function(repository) {
let ghUserRepo = gh.getRepo(repository.owner, repository.name);
ghUserRepo.getDetails(function(err, data) {
console.log(data);
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment