@aero/corona
TypeScript icon, indicating that this package has built-in type declarations

1.6.0 • Public • Published

COVID-19 Statistics

Tiny API wrapper with caching for https://corona.lmao.ninja using centra.

Usage

const { CoronaClient } = require('@aero/corona');

const corona = new CoronaClient({
	lifetime: 8000 // cache lifetime in milliseconds
});
corona.total(): Promise<TotalStats>

corona.country(countryCode: string): Promise<CountryStats>
class CountryStats {
	name: string;
	cases: number;
	todayCases: number;
	deaths: number;
	todayDeaths: number;
	recovered: number;
	critical: number;
	active: number;
	casesPerOneMillion: number;
	deathsPerOneMillion: number;
}
class TotalStats {
	cases: number;
	deaths: number;
	recovered: number;
	updated: Date;
}

Readme

Keywords

none

Package Sidebar

Install

npm i @aero/corona

Weekly Downloads

13

Version

1.6.0

License

BSD-3-Clause

Unpacked Size

8.45 kB

Total Files

10

Last publish

Collaborators

  • nekiono
  • princessravy