Closed Rafael-Silva-Oliveira closed 2 months ago
Hey @Rafael-Silva-Oliveira
You need to decide if you want to get the data via callback or from a promise. You're mixing both.
So you either want:
// Callback
yahooFinance.historical(options, function callback(err, quotes) {
if (err) throw err;
console.log(quotes);
});
or
// Promise using await syntax
const quotes = await yahooFinance.historical(options);
// Traditional promise syntax
yahooFinance.historical(options).then(quotes => { console.log(quotes); });
Hope this helps :)
Also if you're just starting out you may want to check out https://github.com/gadicc/node-yahoo-finance2 which is the next version of this library, currently in beta but pretty well tested.
Thank you so much for your help, @gadicc! I'll check the new version right now, I appreciate your help :)
I'm just trying to run the historical example provided on the mainpage and I keep getting this output:
Code:
Output:
What am I missing to get the code running? I've checked the dependencies and they're all functioning
Thank you in advance!