1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-09-09 16:53:33 +02:00

Compress roadmaps JSONs

This commit is contained in:
Kamran Ahmed
2023-01-05 19:27:35 +04:00
parent af27626a1c
commit fbdf3a6942
23 changed files with 37 additions and 201115 deletions

14
bin/compress-jsons.cjs Normal file
View File

@@ -0,0 +1,14 @@
const fs = require('node:fs');
const path = require('node:path');
const jsonsDir = path.join(process.cwd(), 'public/jsons');
const jsonFiles = fs.readdirSync(jsonsDir);
jsonFiles.forEach((jsonFileName) => {
console.log(`Compressing ${jsonFileName}...`);
const jsonFilePath = path.join(jsonsDir, jsonFileName);
const json = require(jsonFilePath);
fs.writeFileSync(jsonFilePath, JSON.stringify(json));
});