Answers for "js read external json file js"

0

edit external json file in javascript

fs = require('fs');
var name = 'fileName.json';
var m = JSON.parse(fs.readFileSync(name).toString());
m.forEach(function(p){
    p.name= m.name;
});
fs.writeFileSync(name, JSON.stringify(m));
Posted by: Guest on April-25-2021
0

js read external json file js

fs = require('fs');
var name = 'myFile.json';
var m = JSON.parse(fs.readFileSync(name).toString());
m.forEach(function(p){
    p.name= m.name;
});
fs.writeFileSync(name, JSON.stringify(m));
Posted by: Guest on May-09-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language