computer-scienceangular-roadmapbackend-roadmapblockchain-roadmapdba-roadmapdeveloper-roadmapdevops-roadmapfrontend-roadmapgo-roadmaphactoberfestjava-roadmapjavascript-roadmapnodejs-roadmappython-roadmapqa-roadmapreact-roadmaproadmapstudy-planvue-roadmapweb3-roadmap
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
615 B
20 lines
615 B
2 years ago
|
const fs = require('node:fs');
|
||
|
const path = require('node:path');
|
||
|
|
||
|
const jsonsDir = path.join(process.cwd(), 'public/jsons');
|
||
2 years ago
|
const childJsonDirs = fs.readdirSync(jsonsDir);
|
||
2 years ago
|
|
||
2 years ago
|
childJsonDirs.forEach((childJsonDir) => {
|
||
|
const fullChildJsonDirPath = path.join(jsonsDir, childJsonDir);
|
||
|
const jsonFiles = fs.readdirSync(fullChildJsonDirPath);
|
||
2 years ago
|
|
||
2 years ago
|
jsonFiles.forEach((jsonFileName) => {
|
||
|
console.log(`Compressing ${jsonFileName}...`);
|
||
2 years ago
|
|
||
2 years ago
|
const jsonFilePath = path.join(fullChildJsonDirPath, jsonFileName);
|
||
|
const json = require(jsonFilePath);
|
||
|
|
||
|
fs.writeFileSync(jsonFilePath, JSON.stringify(json));
|
||
|
});
|
||
2 years ago
|
});
|