covid-19-api
- A very lightweight and simple corona-stats-api
usage
const covid = require("corona-api");
var api = new covid();
api.all().then(r => console.log(r));
{
updated: 1590385056654,
cases: 5502590,
todayCases: 8135,
deaths: 346761,
todayDeaths: 327,
recovered: 2302469,
active: 2853360,
critical: 53223,
casesPerOneMillion: 706,
deathsPerOneMillion: 44.5,
tests: 71646009,
testsPerOneMillion: 9244,
population: 7750542970,
activePerOneMillion: 368.15,
recoveredPerOneMillion: 297.07,
criticalPerOneMillion: 6.87,
affectedCountries: 215
}
- get every country's data which are affected
const covid = require("corona-api");
var api = new covid();
api.countries_all().then(r => console.log(r));
- get a specified country data
const covid = require("corona-api");
var api = new covid();
api.country("india").then(r => console.log(r));
- get every US state's data
const covid = require("corona-api");
var api = new covid();
api.states_all().then(r => console.log(r));
const covid = require("corona-api");
var api = new covid();
api.state("washington").then(r => console.log(r));