Answers for "node read json array in json files"

8

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 "Javascript"

Browse Popular Code Answers by Language