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

@kolyaventuri/covid-act-now

v1.1.0

Published

CovidActNow.org API client

Downloads

11

Readme

CovidActNow


XO code style

A CovidActNow.org API client written in TypeScript.

Note: @kolyaventuri is not affiliated with CovidActNow in any way. This is moreso a side-project, as a way to explore building a strictly typed API client from the ground up.


Installing

Browser: <script type="text/javascript" src="https://unpkg.com/@kolyaventuri/covid-act-now"/>

Node: npm install @kolyaventuri/covid-act-now

Usage

// import CovidActNow from '@kolyaventuri/covid-act-now';

const client = new CovidActNow(`{API_KEY}`);

...

await client.state.az(); // Get current data for Arizona

Typescript Support

Types are importable on their own via the /types directory

import {County} from '@kolyaventuri/covid-act-now/types';

The API

Generally the structure follows what is outlined on CovidActNow.org, under their API docs section (https://apidocs.covidactnow.org/api/). The schema outlined in their docs is equivalent to the included type definitions.

All States

client.states()

  • Returns a Promise, resolving with a summary for all states.

client.states.timeseries()

  • Returns a Promise, resolving with a summary of timeseries data for all states

Singular State

client.state.<state abbreviation>()

  • Returns a Promise, resolving with a summary for a single state (ex: client.state.az())

client.state.<state abbreviation>.timeseries()

  • Returns a Promise, resolving with a summary with timeseries data for a single state (ex: client.state.az.timeseries())

client.state.<state abbreviation>.counties()

  • Returns a Promise, resolving with a summary for all counties for a single state (ex: client.state.az.counties())

client.state<state abbreviation>.counties.timeseries()

  • Returns a Promise, resolving with a summary with timeseries data for all counties in a single state (ex: client.state.az.counties.timeseries())

All Counties

client.counties()

  • Returns a Promise, resolving with a summary for all counties.

client.counties.timeseries()

  • Returns a Promise, resolving with a summary with timeseries data for all counties.

Singular County

client.county('{fipsCode}')()

  • Returns a Promise, resolving with a summary of a single county.

client.county({fipsCode}).timeseries()

  • Returns a Promise, resolving with a summary with timeseries data for a single county.

All counties in a state

  • See entry under Singular State.

All Metros (CBSAs)

client.metros()

  • Returns a Promise, resolving with a summary for all metro areas.

client.metros.timeseries()

  • Returns a Promise, resolving with a summary with timeseries data for all metro areas.

Singular Metro (CBSA)

client.metro({fipsCode})()

  • Returns a Promise, resolving with a summary for a single metro area.

client.metro({fipsCode}).timeseries()

  • Returns a Promise, resolving with a summary with timeseries data for a single metro area.

Country Level Data

client.country()

  • Returns a Promise, resolving with a summary for the entire United States.

client.country.timeseries()

  • Returns a Promise, resolving with a summary with timeseries data for the entire United States.

Contributing

PRs are more than welcome! There's some more work to do, such as parsing dates out of the response data (string -> Date conversion), and some more robust docs.

Running Tests

  • npm run test will run the linter (tsc && xo), and the test with ava
  • npm run test:integration will run a basic integration suite, provided you have defined your COVID_ACT_NOW_KEY in a .env file (see .env.example)