aboutsummaryrefslogtreecommitdiff
path: root/api/github.js
blob: d08663f5faedd41ce58e06decb7d6c12d3b47a9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const { Octokit } = require("@octokit/rest");
class Github {
    octokit = null;
    username = null;
    constructor(username) {
        this.octokit = new Octokit();
        this.username = username;
    }
    async getRepos(page) {
        const { data } = await this.octokit.repos.listForUser({
            username: this.username,
            type: "all",
            sort: "updated",
            per_page: 25,
            page: page
        });
        return data;
    }
}

exports.Github = Github;