It turns out that jQuery is really meant for the browser and not Node.js. The fetch api works equally well on both, but I'll give details in my next blog post. After some searches, it turns that you need to initialize jQuery with a window object. You can create a fake window object with jsdom. Here is the solution I used:
jquery-tests.ts
I'm enjoying some snow in beautiful Canada right now while working remotely, so here is the output:
output.txt
This is the tsconfig.js for the project:
tsconfig.js
and the FreeGeoIP.d.ts generated from the sample json:
FreeGeoIP.d.ts
These are the npm packages I installed:
install.sh