aboutsummaryrefslogtreecommitdiff
path: root/src/files.js
blob: 970d28de3a5338723f7f4ab9a0d9cdaac25ba0e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import * as yml from "js-yaml"
import * as fs from "fs"

const dir = "./public";

function readConfig() {
    return yml.load(fs.readFileSync(`${dir}/config.yaml`, 'utf8'));
}

function readStyle() {
    return fs.readFileSync(`${dir}/style.css`, 'utf8');
}

export function readXML() {
    return fs.readFileSync(`${dir}/data.xml`, 'utf8');
}

export const c = readConfig();

c.style = `<style>${readStyle()}</style>`;