I'm trying to use the mlb-stats-api in NodeJS but am running into this issue. Whenever I run the script in runkit it runs completely fine but whenever I try to run it in my terminal I get this error:
SyntaxError: await is only valid in async functions and the top level bodies of modules
Here is the script I am trying to run based off of the documentation:
const MLBStatsAPI = require('mlb-stats-api');
const mlbStats = new MLBStatsAPI();
const response = await mlbStats.getDivisions();