Use console.log instead of fs.appendFileSync.