Answers for "javascript object from json file"

1

json file to object js

var data = JSON.parse(fs.readFileSync(filePath));
Posted by: Guest on August-04-2021
2

javascript read json file

const fs = require('fs');

let rawdata = fs.readFileSync('student.json');
let student = JSON.parse(rawdata);
console.log(student);
Posted by: Guest on February-25-2021
0

read json file into object javascript

fs.readFile(filePath, function (error, content) {
    var data = JSON.parse(content);
    console.log(data.collection.length);
});
Posted by: Guest on April-27-2021

Code answers related to "javascript object from json file"

Code answers related to "Javascript"

Browse Popular Code Answers by Language