I am setting up a randomizer for my website using nodejs, but I keep getting a SyntaxError at the end of my script. I personally cannot find it and request help if available!
So far I have messed around with looking upwards to see if the error is further in the code and found nothing.
function time() {
return parseInt(new Date().getTime()/1000)
}
function generate(count) {
return crypto.randomBytes(count).toString('hex');
}
function array_limit(wartosc){
if(chat_history.length==25){
chat_history.shift();
chat_history.shift();
}
chat_history.push(wartosc);
}
function jp_limit(wartosc){
if(jpWinners.length==10){
jpWinners.shift();
}
jpWinners.push(wartosc);
}
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1) + min);
} //this is the error line
I believe this should run just fine, my console output is below, maybe I am making a nube mistake but am seriously considering checking in to my nearest eye-doctor! :
:2241
});
^
SyntaxError: Unexpected token }
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
Edit1: Current version is version (8.16.0-1nodesource1).
Config.js
var config = {};
config.db = '';
config.host = '';
config.user = '';
config.password = '';
config.admin = '';
config.botsteamid = {bot1:''};
config.identitysecret = '';
config.sharedsecret = '';
config.polling_interval = 5000;
config.bot_username = '';
config.bot_password = '';
config.manager_domain = '';
config.manager_lang = 'en';
config.manager_cancelTime = 60000;
module.exports = config;
I removed some sensitive data*