-
Notifications
You must be signed in to change notification settings - Fork 0
/
github.js
37 lines (26 loc) 路 825 Bytes
/
github.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
class Github {
static http() {
return class {
static URL = 'https://api.github.com/repos/langprogramming-AsmX/AsmX';
static get(route) {
return fetch(`${this.URL}${route}`, { method: 'GET' }).then(response => response.json());
}
}
}
static async releases() {
return this.http().get('/releases');
}
static async stargazers() {
return this.http().get('/stargazers');
}
static tags() {
return this.http().get('/tags');
}
static fork() {
return this;
}
static async readme() {
return await fetch ('https://raw.githubusercontent.com/langprogramming-AsmX/AsmX/main/README.md', { method: 'GET' }).then(r => r.text())
}
}
module.exports = Github;