📅  最后修改于: 2022-03-11 15:02:14.797000             🧑  作者: Mango
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));