const fs = require('fs')
function getFileContents(file) {
try {
return fs.readFileSync(file, 'utf8')
} catch (e) {
console.log('error in function getFileContents', e)
}
}
Last active
March 11, 2021 03:22
-
-
Save rpivo/db23d0d19a7c4329a68bb87def4628b1 to your computer and use it in GitHub Desktop.
Getting a File's Contents in Node
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment