const fs = require("fs");
const path = require("path");
const buffer = fs.readFileSync(path.resolve(__dirname, "../json/student.json"));
const json = JSON.parse(buffer);
console.log(json);
const fs = require("fs");
const path = require("path");
const buffer = fs.readFileSync(path.resolve(__dirname, "../json/student.json"));
const json = JSON.parse(buffer);
console.log(json);
本文标题:同步读取json文件并转为JSON对象
本文链接:https://www.haomeiwen.com/subject/kfetqltx.html
网友评论