npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

covid19-scraper

v1.0.0

Published

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

Downloads

15

Readme

Covid19 Scraper

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 by your own risk.

Install

npm install covid19-scraper --save

Features

  • Get Total data
  • Get All data by country name
  • Get Total death data by day
  • Get Daily death data by day

Usage

Get Total data

var covid19 = require('covid19-scraper');

covid19.Stats.getTotalStats().then(function(data) {
    console.log(data)
});

getTotalStats returns an array containing total stats.

{
  total: [
    {
      totalCases: '1,092,986',
      newCases: '+77,921',
      totalDeaths: '58,727',
      newDeaths: '+5,560',
      totalRecovered: '228,038',
      activeCases: '806,221',
      criticalCases: '39,402',
      ratio: '140.2',
      deathRatio: '7.5'
    }
  ]
}

Get All data

var covid19 = require('covid19-scraper');

covid19.Stats.all().then(function(data) {
    console.log(data)
});

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

{
  stats: [
     {
          country: 'Japan',
          searchLink: null,
          searchKeyword: null,
          totalCases: '2,617',
          newCases: '',
          totalDeaths: '63 ',
          newDeaths: null,
          totalRecovered: '514',
          activeCases: '2,040',
          criticalCases: '60',
          ratio: '21',
          deathRatio: '0.5'
    },
    {
          country: 'Indonesia',
          searchLink: 'country/indonesia/',
          searchKeyword: 'indonesia',
          totalCases: '1,986',
          newCases: '+196',
          totalDeaths: '181 ',
          newDeaths: '+11',
          totalRecovered: '134',
          activeCases: '1,671',
          criticalCases: null,
          ratio: '7',
          deathRatio: '0.7'
    },
  ]
}

Get Total death data by day

var covid19 = require('covid19-scraper');

covid19.Stats.getTotalDeathByDay().then(function(data) {
    console.log(data)
});

getTotalDeathByDay returns an array containing total death by daily.

{
 stats: [
     {
       date: ' Apr. 2  ',
       totalDeath: '53,167',
       changeDeath: '5,969',
       changeDeathPercent: '13%'
     },
     {
       date: ' Apr. 1  ',
       totalDeath: '47,198',
       changeDeath: '4,889',
       changeDeathPercent: '12%'
     },
    ]
}

Get Daily death data by day

var covid19 = require('covid19-scraper');

covid19.Stats.getDailyDeathByDay().then(function(data) {
    console.log(data)
});

getDailyDeathByDay returns an array containing daily death by daily.

{
 stats: [
    {
      date: ' Apr. 2  ',
      dailyDeath: '5,969',
      dailyChange: '1,080',
      dailyChangePercent: '22%'
    },
    {
      date: ' Apr. 1  ',
      dailyDeath: '4,889',
      dailyChange: '354',
      dailyChangePercent: '8%'
    },
    ]
}

Issues

If any issues are found, they can be reported here.

License

This project is licensed under the MIT license.