API for Current cases and more stuff about COVID-19 or the Novel Coronavirus Strain.
Check out our homepage and sign up for our newsletter here
NovelCovid API is recommended by Postman here
NovelCovid/API Documentation can be found here
- Download redis from https://redis.io/topics/quickstart
- Start redis server using
redis-server
- Fork and clone git repository
- In root project folder, create a new file called
config.json
- Copy contents for
config.example.json
to newconfig.json
file - Replace password field with
""
and port field to whatever localhost port you want. - From root of project, run
npm run start:dev
- In your browser, go to
localhost:{port}
to test your local changes
- Fork and clone git repository
- In root project folder, make a new file called
.env
- Copy contents for
example.env
to new.env
file - Replace password field with
"yourpassword"
or leave it blank, and port field same withindocker-compose.yml
. - Replace redis host "localhost" with "redis".
- Run command
npm run docker-start-dev
.
We suggest you load the module via require
, considering ES modules in Node.js are not yet stable.
Executing a method will return a Promise. The examples here utilise async/await to access the data.
JavaScript:
const { NovelCovid } = require('novelcovid');
TypeScript:
import { NovelCovid } from 'novelcovid';
Everything is listed on the npm site.
Since data.updated
returns milliseconds, you can do new Date(data.updated)
as it returns an ISO Date
You can read more about new Date() here
For further support, you can join our discord server! More Tutorials can be found there too! https://discord.gg/EvbMshU
https://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data/csse_covid_19_time_series
Thanks goes to these wonderful people (emoji key):
Did you build a project with our API? We now offer an "awesome-list" for you to add your projects into so people can find out about them!