MapList/index.js

16 lines
392 B
JavaScript
Raw Normal View History

2023-06-11 09:31:32 +03:00
const fs = require("fs");
const index = JSON.parse(fs.readFileSync("./index.json", "utf-8"));
let readme = "# CIM Engine map list\n\n";
2023-06-11 09:33:15 +03:00
let k = 1;
2023-06-11 09:31:32 +03:00
for (let id in index) {
let item = index[id];
2023-06-11 09:33:15 +03:00
readme += `${k++}. ${item.name} ${
2023-06-11 09:31:32 +03:00
item.description ? `- ${item.description}` : ""
2023-06-11 09:33:15 +03:00
} ([${id}](https://cimengine.github.io/map/?id=${id}))\n`;
2023-06-11 09:31:32 +03:00
}
fs.writeFileSync("./README.md", readme);