corona-api
v0.0.2
Published
A lightweight and simplified corona stats package
Downloads
11
Maintainers
Readme
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)); //Logs a array of global stats
//outout as below
{
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)); //Logs a array of all countries name and corona details that are affected
- get a specified country data
const covid = require("corona-api");
var api = new covid();
api.country("india").then(r => console.log(r)); //Logs a array of all covid details in a specifiec country
- get every US state's data
const covid = require("corona-api");
var api = new covid();
api.states_all().then(r => console.log(r)); //Logs a array of all US states affected by covid
const covid = require("corona-api");
var api = new covid();
api.state("washington").then(r => console.log(r)); //Logs a array of specified US state's covid details