Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

update file json trong javascript

//change the value in the in-memory object
content.val1 = 42;
//Serialize as JSON and Write it to a file
fs.writeFileSync(filename, JSON.stringify(content));
Comment

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));
Comment

PREVIOUS NEXT
Code Example
Javascript :: react router 
Javascript :: how to routing in react js 
Javascript :: react save to local storage 
Javascript :: find duplicate values in array object javascript 
Javascript :: random item from array javascript 
Javascript :: fetch in react 
Javascript :: regex to indentify url 
Javascript :: javascript get first 3 characters of string 
Javascript :: Reverse pyramid star pattern in JavaScript 
Javascript :: get input type js 
Javascript :: xmlhttprequest pass parameters post 
Javascript :: get authorization header javascript in my page 
Javascript :: empty input of clone jquery 
Javascript :: js compare arrays 
Javascript :: count array in javascript 
Javascript :: reverse a number in javascript w3schools 
Javascript :: expo go something went wrong network response timed out 
Javascript :: javascript style multiple properties 
Javascript :: js querySelectorAll map sample 
Javascript :: on focus jquery 
Javascript :: get index of selected option javascript 
Javascript :: js reverse nested array 
Javascript :: disable scroll react 
Javascript :: cosnsole.log without obj object 
Javascript :: how to set cookies in node js 
Javascript :: javascript findindex 
Javascript :: cancel button in react js 
Javascript :: date and time in javascript 
Javascript :: django jquery 
Javascript :: jsp include html 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =