1const fs = require('fs');
2const path = require('path');
3
4let rawdata = fs.readFileSync(path.resolve(__dirname, 'student.json'));
5let student = JSON.parse(rawdata);
6console.log(student);
1D:\NodeJs>node readsync.js
2 *START*
3Output Content:
4 /* content here */
5*EXIT*
6// Define JSON File
7 var fs = require("fs");
8 console.log("\n *STARTING* \n");
9// Get content from file
10 var contents = fs.readFileSync("jsoncontent.json");
11// Define to JSON type
12 var jsonContent = JSON.parse(contents);
13// Get Value from JSON
14 console.log("User Name:", jsonContent.username);
15 console.log("Email:", jsonContent.email);
16 console.log("Password:", jsonContent.password);
17log("\n *EXIT* \n");
18
1const ciqlJson = require("ciql-json")
2
3ciqlJson
4 .open("file.json")
5 .set("address", {town : "", city : ""})
6 .save()