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.
15 lines
416 B
15 lines
416 B
2 years ago
|
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));
|
||
|
});
|