# github-leaderboard-npm-package

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

Latest version **1.0.3** (published 2023-01-01) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install github-leaderboard-npm-package
pnpm add github-leaderboard-npm-package
yarn add github-leaderboard-npm-package
bun add github-leaderboard-npm-package
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2023-01-01 |
| First published | 2022-03-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.7 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | SLIIT-FOSS |
| Maintainers | sliit.foss |
| Keywords | leaderboard, github leaderboard, organization leaderboard, repository leaderboard, contributors, github contributors, organization contributors, repository contributors |

## Links

- npm: https://www.npmjs.com/package/github-leaderboard-npm-package
- Repository: https://github.com/sliit-foss/github-leaderboard-npm-package
- Homepage: https://github.com/sliit-foss/github-leaderboard-npm-package#readme
- Issues: https://github.com/sliit-foss/github-leaderboard-npm-package/issues
- npm.io page: https://npm.io/package/github-leaderboard-npm-package

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.26.0

## Recent versions

- 1.0.3 (latest) — 2023-01-01
- 1.0.2 — 2022-03-12
- 1.0.1 — 2022-03-12
- 1.0.0 — 2022-03-12

## README

# 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

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

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

## Usage

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

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

## Example

### Using promises:

```js
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:

```js
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();
```

---
_Source: https://npm.io/package/github-leaderboard-npm-package · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
