Answers for "how to read a json file in express node js"

2

read json file node js

function readJsonFile(file) {
    let bufferData = fs.readFileSync(file)
    let stData = bufferData.toString()
    let data = JSON.parse(stData)
    return data
}
Posted by: Guest on June-07-2021

Code answers related to "how to read a json file in express node js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language