You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
git/scr/模糊专家系统/fuzzy-expert/merger.js

13 lines
344 B

let fs = require("fs");
let path = require("path");
let files = fs.readdirSync("./result");
let merged=[];
files.forEach(file => {
let data = JSON.parse(fs.readFileSync(path.join('./result', file), { encoding: "utf8" }));
merged.push(data);
});
fs.writeFileSync("merged.json", JSON.stringify(merged, null, 4), { encoding: "utf8" });