Jsonwrite

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

var file_content = fs.

readFileSync(filename);
var content = JSON.parse(file_content);
var val1 = content.val1;
content.val1 = 42;
//Serialize as JSON and Write it to a file
fs.writeFileSync(filename, JSON.stringify(content));

You might also like