同步读取json文件并转为JSON对象
2021-03-02 本文已影响0人
Codifier
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);