Published
- 1 min read
node write text to file
The solution for this is noted below
node write text to file
Solution
JS
copy
const fs = require('fs')
const content = 'Some content!'
fs.writeFile('/Users/joe/test.txt', content, (err) => {
if (err) {
console.error(err)
return
}
//file written successfully
})
Try other methods by searching on the site. That is if this doesn’t work