Open zeke opened 4 years ago
I think it's due to the fact I am using fetch without node-fetch. Can you try to fork the library and to add node-fetch ?
I ended up rolling my own solution for this using octokit:
require('dotenv-safe').config()
const { Octokit } = require('@octokit/core')
const { paginateRest } = require('@octokit/plugin-paginate-rest')
const MyOctokit = Octokit.plugin(paginateRest)
const octokit = new MyOctokit({ auth: process.env.GITHUB_TOKEN })
// Hit the REST API to collect contributor data for an individual file.
async function getContributorsForFile (owner, repo, path) {
// paginate all contribution to this file
const contributors = await octokit.paginate('GET /repos/:owner/:repo/commits', {
owner,
repo,
path,
per_page: 100
})
return contributors
}
I will likely not use this library again but wanted to give you a heads up. Feel free to close this issue if you like.
Well done ! I will leave it open for other people who have the same problems.
Hi there, @sandoche đź‘‹
Just giving this library a try. I'm getting this error:
I suspect this is because all the dependencies are declared as
devDependencies
, so they're not installed when the package isnpm install
ed.