1fs = require('fs');
2var name = 'fileName.json';
3var m = JSON.parse(fs.readFileSync(name).toString());
4m.forEach(function(p){
5 p.name= m.name;
6});
7fs.writeFileSync(name, JSON.stringify(m));
8
1fs = require('fs');
2var name = 'myFile.json';
3var m = JSON.parse(fs.readFileSync(name).toString());
4m.forEach(function(p){
5 p.name= m.name;
6});
7fs.writeFileSync(name, JSON.stringify(m));