SyntaxFix
Write A Post
Hire A Developer
Questions
If you're geting [object object] then use JSON.stringify
[object object]
JSON.stringify
fs.writeFile('./data.json', JSON.stringify(obj) , 'utf-8');
It worked for me.