Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

read a json in nodejs

'use strict';

const fs = require('fs');

fs.readFile('student.json', (err, data) => {
    if (err) throw err;
    let student = JSON.parse(data);
    console.log(student);
});

console.log('This is after the read call');
Source by stackabuse.com #
 
PREVIOUS NEXT
Tagged: #read #json #nodejs
ADD COMMENT
Topic
Name
9+6 =