Python, nodejs read json file

The first thing that is read is a string, not an object or a dictionary, so it needs to be converted in one step. In the same way, this operation is also required when storing. Otherwise, the operation will be deformed.
Strings in json files or strings in arrays, use double quotes
1. nodejs to read json files (asynchronously, synchronously) to
read synchronously

//导入模块
const fs=require("fs");
//读取文件json.josn
//将读取的数据转为字符串(这里可以不要)
var data=String(fs.readFileSync(

Guess you like

Origin blog.csdn.net/Cml_l/article/details/114632516