Attempt 1 to add a darkmode

This commit is contained in:
2025-10-17 12:35:48 +01:00
parent 8df71a6457
commit 59d16ebde1
10 changed files with 200 additions and 43 deletions

View File

@@ -0,0 +1,20 @@
import { promises as fs } from 'fs';
import path from 'path';
import { Register } from '@/utils/register_parser';
import { parseNextReg } from '@/utils/register_parser';
let registers: Register[] = [];
/**
* Gets the registers from the in-memory cache, or loads them from the file if not already loaded.
* @returns A promise that resolves to an array of Register objects.
*/
export async function getRegisters(): Promise<Register[]> {
// if (registers.length === 0) {
const filePath = path.join(process.cwd(), 'data', 'nextreg.txt');
const fileContent = await fs.readFile(filePath, 'utf8');
registers = await parseNextReg(fileContent);
// }
return registers;
}