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 = const corona = await worldometer//returns object
- Country Data
const worldometer = const corona = await worldometer//returns object or throw error if false country or no country was provided
- Typescript Example
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//returns objectconst totalCases = coronatotalCases //returns total casesconst totalDeaths = coronatotalDeathsconst totalRecovered = coronatotalRecoveredconst activeCases = coronaactiveCasesconst closedCases = coronaclosedCasesconst mildCases = coronaconditionmildconst criticalCases=coronaconditioncritical
Using Country Data
const corona = await worldometerconst totalCases = coronacasestotal //total casesconst recovered = coronacasesrecoveredconst deaths = coronacasesdeathsconst dischargePercent = coronaclosedCasespercentagedischargeconst deathPercent = coronaclosedCasespercentagedeathconst closedCases = coronaclosedCasestotalconst flagImg = coronacountryflagImg //returns flag image ex:https://www.worldometers.info/img/flags/small/tn_us-flag.gifconst countryName = coronacountryname
Typescript
- here is an compiler example to use this package