2.0.1 • Published 4 years ago

covidtracker v2.0.1

Weekly downloads
223
License
ISC
Repository
github
Last release
4 years ago

Covid-19 Tracker

View information on the Coronavirus outbreak around the world. Updated By: Apollo#6000

Update:

npm InstallSize Discord

Beta NPM Package

Installation

Stable Release (v2.0.1)

npm i covidtracker@2.0.1

Methods

.getAll()

.getCountry({country, sort})

.getState({state, sort})

.getHistoric({country, province})

.getJHU({country, province, sort})

Loading and using the module

We suggest you load the module via require, pending the stabalizing of es modules in node:

const covid = require('covidtracker');

Documentation

To actually use the data, you will need an async/await.

// Declare the package
const covid = require('covidtracker');

// Now we create a async/await
(async () => {

    // Now we await it.
    let all = await covid.getAll();

    // Make sure you return it, this usually implies if you are using this inside a function.
    // Use \n to break lines.
    return console.log(`Cases: ${all.cases}\nDeaths: ${all.deaths}\nRecovered: ${all.recovered}`)
})()

Sorting the data.

Some methods can be sorted.

const covid = require('covidtracker');

(async () => {
    let sortedCountries = await covid.getCountry({sort: 'recovered'});
    return console.log(sortedCountries);

    let sortedStates = await covid.getState({sort: 'deaths'});
    return console.log(sortedStates);
})();

Filtering for a specific country/state.

const covid = require('covidtracker');

(async () => {
   // Specific Country
   let specificCountry = await covid.getCountry({country: 'United States'});
   return console.log(specificCountry);
   
   // Specific State
   let specificState = await covid.getState({state: 'New York'});
   return console.log(specificCountry);
})();
1.1.1

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

0.0.5

4 years ago

0.0.6

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago