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

covid19-us-wa

v1.3.1

Published

covid19 data for United States, Washington

Downloads

13

Readme

covid19-us-wa

NPM

What is covid19-us-wa?

"covid19-us-wa" is a library that retrieves current published COVID-19 data from the Washington State Department of Health website. Data is starting March 11, 2020. Data source is updated daily by WADOH and history is incorporated within few hours of the published report.

Data is retrieved daily from https://www.doh.wa.gov/emergencies/coronavirus

Historic visualization of the dataset is on the projects page: https://winfinit.github.io/covid19-us-wa/

Methods

getCurrentData()

Returns latest data from the states site

getHistoryData()

Returns historic data, including latest update.

getShortHistoryData()

Returns abbreviated historic data by removing county key.

Usage

Node.js

let Covid19USWA = require("covid19-us-wa").Covid19USWA;

let covid19USWA = new Covid19USWA();
covid19USWA.getCurrentData().then(data => {
    console.log("data", data);
    /*
        Sample output: 
            {
                "county":{
                    "Clark":{
                        "positive":1,
                        "deaths":0
                    },
                    "Grant":{
                        "positive":1,
                        "deaths":1
                    }
                },
                "total":{
                    "positive":366,
                    "deaths":29,
                    "new_positive":33,
                    "new_deaths":1
                },
                "total_tests":{
                    "positive":366,
                    "negative":3037,
                    "new_positive":11,
                    "new_negative":44
                },
                "last_updated":"2020-03-23T07:00:00.000Z"
            }
    */
});

covid19USWA.getHistoryData().then(data => {
    console.log("data", data);
    /* 
        Sample output:
            {
                "03/11/2020":{
                    "county":{
                        "Clark":{
                            "positive":1,
                            "deaths":0
                        },
                        "Grant":{
                            "positive":1,
                            "deaths":0
                        }
                    },
                    "total":{
                        "positive":366,
                        "deaths":29,
                        "new_positive":33,
                        "new_deaths":1
                    },
                    "total_tests":{
                        "positive":366,
                        "negative":3037,
                        "new_positive":11,
                        "new_negative":44
                    },
                    "last_updated":"2020-03-23T07:00:00.000Z"
                }
            }
    */
});

covid19USWA.getShortHistoryData().then(data => {
    console.log("data", data);
    /* 
        Sample output:
    {
        "2020-03-23": {
            "total": {
                "positive": 2221,
                "deaths": 110,
                "new_deaths": 15,
                "new_positive": 225
            },
            "total_tests": {
                "negative": 31712,
                "positive": 2221,
                "new_positive": 225,
                "new_negative": 2833
            }
        }
    }
    */
});

TypeScript

import {
    Covid19USWA,
    ICovid19USWACurrent,
    ICovid19USWAHistory,
    ICovid19USWAShortHistory
} from 'covid19-us';

let covid19USWA = new Covid19USWA();
covid19USWA.getCurrentData().then((data: ICovid19USWACurrent) => {
    console.log(data);
}); 

covid19USWA.getHistoryData().then((data: ICovid19USWAHistory) => {
    console.log(data);
}); 

covid19USWA.getShortHistoryData().then((data: ICovid19USWAShortHistory) => {
    console.log(data);
});