Last active
April 27, 2022 21:44
-
-
Save alundiak/295309a8aab3cc58701804ab1e5b0f29 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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