Collect all the image file URLs in a GitHub repository
npm install repo-images --save
const repoImages = require('repo-images')
repoImages('user/repo').then(images => {
// an array of image objects
})
Each object in the returned array has this structure:
{
path: 'build/icon.icns',
mode: '100644',
type: 'blob',
sha: '3e7e2a36f9d1a5dfcaae886d0c0e5043b3ffee6a',
size: 1192844,
url: 'https://api.github.com/repos/ummoji/ummoji-desktop/git/blobs/3e7e2a36f9d1a5dfcaae886d0c0e5043b3ffee6a',
rawgit: 'https://cdn.rawgit.com/ummoji/ummoji-desktop/master/build/icon.icns'
}
The default branch is master, but you can override it:
repoImages('user/repo', {branch: 'not-master'})
token option is set, it will be used.process.env.GITHUB_ACCESS_TOKEN is set, it will be used.If you don't like promises, you can use a node-style callback:
repoImages('user/repo', function(err, images) {
if (err) throw err
console.log(images)
})
npm install
npm test
got to interact with the GitHub APIMIT
Generated by package-json-to-readme