Created
September 8, 2020 05:26
-
-
Save watilde/640d2755f6a8a6b0ab3747cf521c0396 to your computer and use it in GitHub Desktop.
This file contains 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
// Refs: https://github.com/hiroppy/node-metrics | |
const fetch = require('node-fetch'); | |
(async () => { | |
const url = 'https://nodejs.org/metrics/summaries/total.csv' | |
const csv = await fetch(url).then((res) => res.text()); | |
let total = 0; | |
csv.split('\n').map(a => a.split(',')).slice(1, -1).forEach((item) => { | |
total += Number(item[1]) | |
}); | |
console.log(total.toLocaleString()) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment