Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

update file json trong javascript

// read file and make object
let content = JSON.parse(fs.readFileSync('file.json', 'utf8'));
// edit or add property
content.expiry_date = 999999999999;
//write file
fs.writeFileSync('file.json', JSON.stringify(content));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #update #file #json #trong #javascript
ADD COMMENT
Topic
Name
5+4 =