相关疑难解决方法(0)

如何更新json文件中的值并通过node.js保存

如何更新json文件中的值并通过node.js保存?我有文件内容:

var file_content = fs.readFileSync(filename);
var content = JSON.parse(file_content);
var val1 = content.val1;
Run Code Online (Sandbox Code Playgroud)

现在我想更改值val1并将其保存到文件中.

json node.js

65
推荐指数
4
解决办法
8万
查看次数

标签 统计

json ×1

node.js ×1