Parse critical tables

This commit is contained in:
2024-10-20 18:21:19 +02:00
parent 973d8733b2
commit 4061371945
13 changed files with 330 additions and 37 deletions

View File

@ -0,0 +1,20 @@
// Parse all the JSON files in the tables directory and create a JS file with the tables
// Create on one object per table with file name as ket and the table data in a field table
// This is a one-time script to create the tables.js file
// Run this script with `node create-js-table.js`
const fs = require('fs');
const path = require('path');
const tablesDir = path.join(__dirname, './');
const tables = {};
fs.readdirSync(tablesDir).forEach(file => {
const table = require(path.join(tablesDir, file));
console.log(`Processing ${file} ${table}`);
//tables[file] = table;
}
);
//fs.writeFileSync(path.join(__dirname, 'tables.js'), `module.exports = ${JSON.stringify(tables, null, 2)};`);
console.log('Tables created');a