Published
- 1 min read
readfilesync
The solution for this is noted below
readfilesync
Solution
const fs = require('fs')
try {
const data = fs.readFileSync('/Users/joe/test.txt', 'utf8')
console.log(data)
} catch (err) {
console.error(err)
}
Try other methods by searching on the site. That is if this doesn’t work