This package has been deprecated

Author message:

This package has been moved under the @sliit-foss namespace and is now available at @sliit-foss/leaderboard. As such, this package is deprecated and no longer maintained.

github-leaderboard-npm-package

1.0.3 • Public • Published

github-leaderboard-npm-package

A node module for fetching a list of highest contributors to a certain Github organization or repository with contribution scores

Installation

# using npm
npm install github-leaderboard-npm-package

# using yarn
yarn add github-leaderboard-npm-package

Usage

# using require
const leaderboard = require('github-leaderboard-npm-package');

# using import
import leaderboard from 'github-leaderboard-npm-package';

Example

Using promises:

leaderboard.initialize('GITHUB_ACCESS_TOKEN')

//fetch organization leaderboard
leaderboard.getOrganizationLeaderboard({
  orgs: 'sliit-foss',
  filters: {
      dateRange: '2021-10-14..2021-10-31',
      label: 'hacktoberfest-accepted'
  },
}).then((results) => console.log(results));

//fetch repository leaderboard
leaderboard.getRepositoryLeaderboard({
  owner: 'sliit-foss',
  repoName: 'sliitfoss',
  filters: {
      dateRange: '2021-10-14..2021-10-31',
      label: 'hacktoberfest-accepted'
  },
}).then((results) => console.log(results));

Using async/await:

leaderboard.initialize('GITHUB_ACCESS_TOKEN')
const getOrganizationLeaderboard = async function () {
    const results = await leaderboard.getOrganizationLeaderboard({
        orgs: ['sliit-foss'],
        filters: {
            dateRange: '2021-10-14..2021-10-31',
            label: 'hacktoberfest-accepted'
        },
    });
    console.log(results);
};

const getRepositoryLeaderboard = async function () {
    const results = await leaderboard.getRepositoryLeaderboard({
        owner: 'sliit-foss',
        repoName: 'sliitfoss',
        filters: {
            dateRange: '2021-10-14..2021-10-31',
            label: 'hacktoberfest-accepted'
        },
    });
    console.log(results);
};

getOrganizationLeaderboard();
getRepositoryLeaderboard();

Package Sidebar

Install

npm i github-leaderboard-npm-package

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

8.89 kB

Total Files

9

Last publish

Collaborators

  • sliit.foss