1 #!/usr/bin/env node 2 3 const fs = require('fs') 4 5 const filePath = '/home/orly/cs-policy-output.txt' 6 7 const fileExists = fs.existsSync(filePath) 8 9 if (fileExists) { 10 fs.appendFileSync(filePath, `${Date.now()}: Hey there!\n`) 11 } else { 12 fs.writeFileSync(filePath, `${Date.now()}: Hey there!\n`) 13 } 14