MapList/index.js
2024-01-23 21:09:44 +03:00

24 lines
533 B
JavaScript

const fs = require("fs");
async function run() {
const index = JSON.parse(fs.readFileSync("./index.json", "utf-8"));
let readme = "# CIMEngine map list\n\n";
let k = 1;
for (let id in index) {
let item = index[id];
if (item.external) {
item = await (await fetch(item.external)).json();
}
readme += `${k++}. ${item.name} ${
item.description ? `- ${item.description}` : ""
} ([${id}](https://cimengine.github.io/map/?id=${id}))\n`;
}
fs.writeFileSync("./README.md", readme);
}
run();