corona-statistics
Version:
Get corona/covid-19 statss
41 lines (33 loc) • 954 B
JavaScript
const { NovelCovid } = require("novelcovid");
const corona = new NovelCovid();
async function allCases() {
const covid = await corona.all();
const data = covid.cases.toLocaleString();
return data;
}
async function allDeaths() {
const covid = await corona.all();
const data = covid.deaths.toLocaleString();
return data;
}
async function allRecovered() {
const covid = await corona.all();
const data = covid.recovered.toLocaleString();
return data;
}
async function todayCases() {
const covid = await corona.all();
const data = covid.todayCases.toLocaleString();
return data;
}
async function todayDeaths() {
const covid = await corona.all();
const data = covid.todayDeaths.toLocaleString();
return data;
}
async function active() {
const covid = await corona.all();
const data = covid.active.toLocaleString();
return data;
}
module.export = [ allCases, allDeaths, allRecovered, todayCases, todayDeaths, active ]