-
-
Save Ry0taK/d3ebb66b8b32f8eca694f362c21b8854 to your computer and use it in GitHub Desktop.
DefinitelyTyped total download count
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let downloads = 0; | |
| let libs = [...]; | |
| async function main(){ | |
| for(let lib of libs){ | |
| console.log(lib) | |
| const res = await fetch("https://api.npmjs.org/downloads/point/last-month/@types/" + lib); | |
| if(res.status != 200){console.log(res.status);break;} | |
| const json = await res.json(); | |
| downloads += json.downloads | |
| } | |
| console.log(downloads) | |
| } | |
| main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment