1.0.0 • Published 4 years ago
find-contributors v1.0.0
Feature
- Get the list of contributors for a specific file of a Github Repository
- The list contain the name, the id, the url of each contributors
How to use
Installation
npm install find-contributors
Using it
- Import getContributors
- Use the following function
getContributors(owner, repositoryName, filePath, token).then(callbackFunction)
- The github token is optional (but it will increase the api limitations)
- See examples below
import getContributors from 'find-contributors';
getContributors('tanahatas', 'Jekyll-webpack-boilerplate', '_i18n/en.yml').then((contributors) => {
console.log(contributors);
/*
This will return
[
{
avatar_url: "https://avatars0.githubusercontent.com/u/26017663?v=4"
login: "tanahatas"
url: "https://github.com/tanahatas"
}
]
*/
});
getContributors('naming-convention', 'naming-convention-design', 'README.md').then((contributors) => {
console.log(contributors);
/*
This will return
[
{
avatar_url: "https://avatars3.githubusercontent.com/u/6988069?v=4"
login: "patriciamayo"
url: "https://github.com/patriciamayo"
},
{
avatar_url: "https://avatars0.githubusercontent.com/u/26017663?v=4"
login: "tanahatas"
url: "https://github.com/tanahatas"
}
]
*/
})
Scripts
yarn build
ornpm run build
- produces production version of your library under thelib
folderyarn dev
ornpm run dev
- produces development version of your library and runs a watcheryarn test
ornpm run test
- it runs the tests :)yarn test:watch
ornpm run test:watch
- same as above but in a watch mode
Show your support
Please ⭐️ this repository if this project helped you!
I Love Coffee
1.0.0
4 years ago