| 45 | ] |
| 46 | |
| 47 | async function getData () { |
| 48 | const [collectiveData_result, githubData_result] = await Promise.all ([fetch ('https://opencollective.com/ccxt.json'), fetch ('https://api.github.com/repos/ccxt/ccxt')]) |
| 49 | const collectiveData = await collectiveData_result.json() |
| 50 | const githubData = await githubData_result.json() |
| 51 | |
| 52 | return { |
| 53 | contributors: collectiveData['contributorsCount'].toLocaleString (), |
| 54 | backers: collectiveData['backersCount'].toLocaleString (), |
| 55 | balance: Math.floor (collectiveData['balance'] / 100).toLocaleString (), |
| 56 | budget: Math.floor (collectiveData['yearlyIncome'] / 100).toLocaleString (), |
| 57 | stars: githubData['stargazers_count'].toLocaleString (), |
| 58 | forks: githubData['forks_count'].toLocaleString (), |
| 59 | size: (githubData['size'] / 1000000).toFixed (2) |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | function pad (string) { |
| 64 | const padding = 80 - string.length |