Elitezen / open-trivia-db-wrapper

A wrapper for the Open Trivia Database API. Built with TypeScript, works with VanillaJS.
https://opentdb.com
MIT License
6 stars 3 forks source link

add support for node < 18 #8

Closed prli closed 1 year ago

prli commented 1 year ago

looking to use in an AWS lambda. the highest version of node runtime supported on AWS is node v16.

fetch used in Utils.ts only exists in node v18+ :(

I end up with the following error

RefernceError: fetch is not defined
prli commented 1 year ago

I have a working branch using node-fetch which works for node < 18 (tested on AWS lambda) but I think it breaks any existing consumers of the library since they need to install peerDependency node-fetch.