UKHSA-Internal/coronavirus-dashboard-api-javascript-sdk

Does not work with node app

Opened this issue · 1 comments

Hi,

Your example does not work in a node.js app. The following error is generated:

const api = new Cov19API({
^
TypeError: Cov19API is not a constructor

I think it may be to do with the way that you transpire your typescript?

What does work is adding ".default" to the require():

const Cov19API = require('@publichealthengland/uk-covid19').default;

Hi @spock64, thanks for the heads up. That's true. I'll correct it later.