Answers for "json file to object js"

-1

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
0

json file to object js

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

Code answers related to "Javascript"

Browse Popular Code Answers by Language