1.0.0 • Published 4 years ago

find-contributors v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

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 or npm run build - produces production version of your library under the lib folder
  • yarn dev or npm run dev - produces development version of your library and runs a watcher
  • yarn test or npm run test - it runs the tests :)
  • yarn test:watch or npm 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

ko-fi

1.0.0

4 years ago