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

worldometer-coronavirus-info

v3.0.0

Published

An easy to use worldometer coronavirus information at ease

Downloads

91

Readme

worldometer-coronavirus-info V3

This is a npm package which will help you to fetch details directly from worldometer.info.

Installing

npm i worldometer-coronavirus-info

Features

  • Fetched Information Directly from worldometer.info and is accurate
  • Very simple to use
  • Lightweight
  • Easy to understand with docs
  • Returns Country flag and name, which is very usefull in some cases

Example

  • Global Data
const worldometer = require('worldometer-coronavirus-info')
const corona = await worldometer.trackAll()//returns object
  • Country Data
const worldometer = require('worldometer-coronavirus-info')
const corona = await worldometer.trackCountry()//returns object or throw error if false country or no country was provided
  • Typescript Example
import worldometer from 'worldometer-coronavirus-info'
const corona = await worldometer.trackAll()

Golbal Data Properties

The following are given property for Global Data | Properties | Description | | :--- | :--- | | totalCases | Gives total cases| | totalDeaths| Gives total Death| | totalRecovered| Gives total Recovered| | activeCases| Gives Active Cases| | closedCases| Gives the cases which had an outcome| |condition#mild|Gives Mild condition number| |condition#critical|Gives critical condition number|

  • If you are having trouble understanding this pls scroll a bit down

Country Data Properties

The following are given property for Country Data | Properties | Description | | :--- | :--- | |cases#totalCases|Gives total Cases| |cases#recovered|Gives total recovered| |cases#deaths|Gives total deaths| |closedCases#percentage#discharge|Gives discharge percent| |closedCases#percentage#death|Gives Death Percent| |closedCases#total|Gives total closed cases number| |country#flagImg|Gives image of flag of the country in gif format but is static| |country#name|Gives the country name|

  • If you are having trouble understanding this pls scroll a bit down

Using Global Data

const corona =await worldometer.trackAll()//returns object
const totalCases = corona.totalCases //returns total cases
const totalDeaths = corona.totalDeaths
const totalRecovered = corona.totalRecovered
const activeCases = corona.activeCases
const closedCases = corona.closedCases
const mildCases = corona.condition.mild
const criticalCases=corona.condition.critical

Using Country Data

const corona = await worldometer.trackCountry('united states')
const totalCases = corona.cases.total //total cases
const recovered = corona.cases.recovered
const deaths = corona.cases.deaths
const dischargePercent = corona.closedCases.percentage.discharge
const deathPercent = corona.closedCases.percentage.death
const closedCases = corona.closedCases.total
const flagImg = corona.country.flagImg //returns flag image ex:https://www.worldometers.info/img/flags/small/tn_us-flag.gif
const countryName = corona.country.name

Typescript

  • here is an compiler example to use this package
{
    "compilerOptions": {
    "noImplicitAny": false,
    "strictNullChecks": true,
    "esModuleInterop":true,
    "target": "ES2018", 
    "module": "commonjs",
    "allowJs": true,
    "moduleResolution": "node",
    "sourceMap": true,
    "lib": ["es2018", "dom"],
    "strict": true
    }
}

Changelog