How ahmadawais/corona-cli works
corona-cli is a terminal COVID-19 reporting tool. Users select worldwide, country, or U.S. state data, then view sorted and limited tabular/JSON results or country line charts and regional bar charts. The main entry point coordinates these distinct reporting paths; data comes from disease.sh, while utility modules format values and define table fields and sorting keys. The graph follows calls visible in the sampled source; README-documented capabilities are retained, but unsampled implementation details are not expanded.
Main entry points: index.js Command entry · getStates.js State reports · getCountries.js Country reports · getWorldwide.js Worldwide totals
Components 16
CLI and orchestration
- Command entry
index.js - Arguments and help
utils/cli.js - Startup checks
utils/init.js - Summary footer
utils/theEnd.js
Data retrieval
- Worldwide totals
utils/getWorldwide.js - Country report
utils/getCountry.js - State reports
utils/getStates.js - Country reports
utils/getCountries.js
Reports and charts
- Country line chart
utils/getCountryChart.js - Regional bar chart
utils/getBar.js - JSON output
utils/JsonOutput.js
Formatting utilities
- Table fields and keys
utils/table.js - Number formatting
utils/numberFormat.js
Other components
- Terminal user
- disease.sh API
- Terminal output
Connections 31
- Terminal user → Command entry: runs command
- Command entry → Arguments and help: reads options
- Command entry → Startup checks: initializes
- Command entry → Worldwide totals: requests totals
- Command entry → Country report: requests country
- Command entry → State reports: requests states
- Command entry → Country reports: requests countries
- Command entry → Country line chart: requests chart
- Command entry → Regional bar chart: requests bars
- Command entry → Summary footer: prints footer
- Worldwide totals → disease.sh API: fetches totals
- Country report → disease.sh API: fetches country
- State reports → disease.sh API: fetches states
- Country reports → disease.sh API: fetches countries
- Country line chart → disease.sh API: fetches history
- Regional bar chart → disease.sh API: fetches regions
- Worldwide totals → Number formatting: formats values
- Country report → Number formatting: formats values
- State reports → Number formatting: formats values
- Country reports → Number formatting: formats values
- Country reports → Table fields and keys: reads sort keys
- State reports → Table fields and keys: reads sort keys
- Regional bar chart → Table fields and keys: reads sort keys
- Command entry → JSON output: selects JSON output
- Worldwide totals → Terminal output: prints report
- Country report → Terminal output: prints report
- State reports → Terminal output: prints report
- Country reports → Terminal output: prints report
- Country line chart → Terminal output: renders chart
- Regional bar chart → Terminal output: renders chart
- Summary footer → Terminal output: prints summary