Socket
Socket
Sign inDemoInstall

corona-api

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

corona-api

A lightweight and simplified corona stats package


Version published
Maintainers
1
Created
Source

covid-19-api

  • A very lightweight and simple corona-stats-api

Badge Badge Badge Badge Badge

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

Keywords

FAQs

Package last updated on 25 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc