Horje
read json from file js Code Example
javascript read json file
const fs = require('fs');

let rawdata = fs.readFileSync('student.json');
let student = JSON.parse(rawdata);
console.log(student);
read json from file js
const fs = require('fs');

fs.readFile('./customer.json', 'utf8', (err, jsonString) => {
  if (err) {
    console.log("File read failed:", err)
    return 
  }
  console.log('File data:', jsonString)
})
Source: medium.com
read json file javascript
fetch("file.json")
    .then(Response => Response.json())
    .then(data => {
        console.log(data);
  		// or whatever you wanna do with the data
    });
read json file into object javascript
fs.readFile(filePath, function (error, content) {
    var data = JSON.parse(content);
    console.log(data.collection.length);
});




Javascript

Related
jquery google Code Example jquery google Code Example
react native socket io Code Example react native socket io Code Example
react native shaddow Code Example react native shaddow Code Example
datatable column width Code Example datatable column width Code Example
react shadow Code Example react shadow Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8