'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');
const fs = require("fs");
var posts = [];
fs.readFile('./data/posts.json', 'utf8', (err, data) => {
if (err) throw err;
posts = JSON.parse(data);
});
const data = '{ "name": "Flavio", "age": 35 }'
try {
const user = JSON.parse(data)
} catch(err) {
console.error(err)
}