Escriba el archivo en el sistema operativo con NodeJS

fs.writeFileSync('./data.json', JSON.stringify(obj, null, 2) , 'utf-8');
Noorullah Ahmadzai