ExodusMovement/cryptocompare

ReferenceError: fetch is not defined

joemccann opened this issue · 2 comments

Attempting to run this via CLI and I get this: ReferenceError: fetch is not defined.

I see that you closed an issue similar to this but did the package not get updated? I'm having to patch it now with:

'use strict'
/* global fetch */
global.fetch = require('isomorphic-fetch')

const baseUrl = 'https://min-api.cryptocompare.com/data/'

But that will break any builds that don't include my node_modules directory. Am I missing something?

This is clearly noted in the readme: https://github.com/ExodusMovement/cryptocompare#usage. The reason is that this module was created for use in the browser or electron, though it works just fine in Node with fetch defined.