CoinGecko-API
CoinGecko-API copied to clipboard
Allow overriding https.request options
Adds to class CoinGecko an optional argument 'processRequestOptions', which is a function that can alter https.request options. Useful for tweaking things like the request timeout.
Example usage:
const CoinGecko = require('./lib/CoinGecko');
(async () => {
const processRequestOptions = (opts) => {
opts.port = 444;
return opts;
};
const CG = new CoinGecko({ processRequestOptions });
await CG.coins.list();
})();