covid19-stats

1.1.4 • Public • Published

Covid19

NPM Package to retrieve worldometers' live statistics of the Covid-19 pandemic. Scraper of worldometers.

Disclaimer

This packages uses web scraping to retrieve the statistical information. This could potentially mean a copyright infringement and be criminally prosecuted. The scraped information belongs to Worldometers and its sources. Use at your own risk.

Usage

Just import the module and run getStats().

const covid19 = requiere('covid19-stats');

let stats = await covid19.getStats();

getStats returns an array containing the stats by country. The countries are named as listed in worldometers.

[
  {
    country: 'WORLD',
    totalCases: 218420,
    newCases: 20189,
    totalDeaths: 8938,
    newDeaths: 960,
  },
  {
    country: 'USA',
    totalCases: 3695025,
    ...
  },
  ...
]

You can also get the data of a specific country.

let usa = await covid19.getCountry('usa');

getStats returns an object containing the information of the desired country. The countries are named as listed in worldometers.

{
  country: 'USA',
  totalCases: 3695025,
  ...
}

Readme

Keywords

Package Sidebar

Install

npm i covid19-stats

Weekly Downloads

3

Version

1.1.4

License

ISC

Unpacked Size

4.76 kB

Total Files

3

Last publish

Collaborators

  • aurmeneta