import fs from 'fs';
const originalData = JSON.parse(fs.readFileSync('index.json', 'utf8'));
console.log(originalData)
let obj = {}
for (let i in originalData) {
    let record = originalData[i]
    for (let e in record) {
        if(obj[e]){
            obj[e].push(record[e])
        }else{
            obj[e] = [record[e]]
        }
    }
}
for (let i in obj){
    fs.writeFileSync(`language/${i}.mjs`, JSON.stringify(obj[i], null, 2), 'utf8');
}
