mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-02-22 10:32:35 +01:00
15 lines
416 B
JavaScript
15 lines
416 B
JavaScript
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));
|
|
});
|