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

@yy3301/covid-fetch

v2.0.2

Published

Covid19 data (India and States) fetched from the government website, effectively in JSON format

Downloads

3

Readme

Covid Fetch

npm (scoped) npm bundle size

A simple package (i.e. a fetcher) for India's COVID-19 data fetched from the Government sources online.

Use this instead of scraping the Government websites from scratch. Collect the data into a usable format (like JSON).

  • Data fetched is the same as shown on the MoHFW website.
  • Data is provided in a more effective format and can be converted into other formats quickly without any hassle
  • Reduce the load on the government facilities c'mon

Usage

Install the package:

$ npm i @yy3301/covid-fetch

To use this:

const cf = require("covid-fetch").default;

cf.cases.getCasesDataState()
.then(stateData => {
    console.log(stateData);
});

Passing the argument true to the function results in getting back a JSON string:

cf.cases.getCasesDataIndia(true)
.then(dataIndia => {
    console.log(dataIndia);
});

Structure of the Data

For India:

[
    {
        Active: number,
        ActivePercent: number,
        Deaths: number,
        DeathPercent: number,
        Discharged: number,
        DischargePercent: number,
        ActiveChange: number,
        DeathChange: number,
        DischargeChange: number,
        TotalVaccination: number,
        VaccineChange: number,
        Timestamp: string,
        UnixTimestamp: number
    }
]

Documentation for India:

  • Active: The number of active cases all over India
  • ActivePercent: Percentage of active cases
  • Deaths: The number of deaths all over India
  • DeathPercent: Percentage of deaths
  • Discharged: The number of cured cases all over India
  • DischargePercent: Percentage of discharged cases
  • ActiveChange, DeathChange, DischargeChange**: Change in the number of active, death or discharged cases since yesterday
  • TotalVaccination: The total number of vaccinations all over india
  • VaccineChange: Change in the number of vaccinations given since yesterday
  • Timestamp, UnixTimestamp: Timestamp of when the data was fetched

For States and UTs:

[
    ...
    {
        sno: string,
        state_name: string,
        active: string,
        positive: string,
        cured: string,
        death: string,
        new_active: string,
        new_positive: string,
        new_cured: string,
        new_death: string,
        death_reconsille: string,
        total: string,
        state_code: string,
        abbr: string,   # abbreviation of the state or UT
        Timestamp: string,
        UnixTimestamp: number
    }
    ...
]

Documentation for States and UTs:

  • sno: Sr number (ez)
  • state_name: Name of the state
  • active: number of previous active cases in that state
  • positive: number of previous positive cases in that state
  • cured: number of cured cases in that state
  • death: number of deaths in that state
  • new_active, new_positive, new_cured, new_death: number of new cases in that state respectively
  • death_reconsille: the number of reconciled deaths in that state
  • total: total number of deaths after reconcilation
  • state_code: State code of that state
  • abbr: Abbreviation of that state
  • Timestamp, UnixTimestamp: Timestamp of when the data was fetched