Writing JSON object to a JSON file with fs.writeFileSync November 30, 2022 by Tarik You need to stringify the object. fs.writeFileSync('../data/phraseFreqs.json', JSON.stringify(output));