mirror of
https://github.com/partofmyid/register.git
synced 2026-06-05 18:46:50 +07:00
12 lines
331 B
JavaScript
12 lines
331 B
JavaScript
const fs = require('fs');
|
|
|
|
const dict = fs.readdirSync('./domains').map(f => [
|
|
f.split('.').slice(0, -1).join('.'),
|
|
JSON.parse(fs.readFileSync(`./domains/${f}`, 'utf8')).owner.username // owner
|
|
]).reduce((v, [s, o]) => {
|
|
if (!v[o]) v[o] = [];
|
|
v[o].push(s);
|
|
return v;
|
|
}, {});
|
|
|
|
console.log(JSON.stringify(dict));
|