Files
KSP-MGA-Planner/dist/main/utilities/data.js
Krafpy 824af087c1 Modified file structure.
Modified the file structure to have the `index.html` at the root
of the repository. Needed for Github Pages.
2021-08-15 21:31:25 +02:00

19 lines
513 B
JavaScript

async function readTextFile(path) {
const response = await fetch(path);
const text = await response.text();
return text;
}
export async function loadBodiesData() {
const content = await readTextFile("./data/kspbodies.yml");
const data = jsyaml.load(content);
return {
sun: data[0],
bodies: data.slice(1)
};
}
export async function loadConfig() {
const content = await readTextFile("./data/config.yml");
const config = jsyaml.load(content);
return config;
}