Skip to content

Instantly share code, notes, and snippets.

@watilde
Created September 8, 2020 05:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save watilde/640d2755f6a8a6b0ab3747cf521c0396 to your computer and use it in GitHub Desktop.
Save watilde/640d2755f6a8a6b0ab3747cf521c0396 to your computer and use it in GitHub Desktop.
// 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