Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #read #external #json #file #js
ADD COMMENT
Topic
Name
2+2 =