JSON.parse(fs.readFileSync()) returning a buffer – string of numbers

fs.readFileSync() returns a Buffer if you don’t specify an encoding.

https://nodejs.org/api/fs.html#fs_fs_readfilesync_path_options

So, tell fs.readFileSync() what encoding to use:

squadJSON = JSON.parse(fs.readFileSync('./squads/squad' + whichSquad + '.json', 'utf8')); 

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)