Create Folder.js

This commit is contained in:
Synthetic
2023-11-15 20:01:57 -05:00
committed by GitHub
parent 3c8ea45a36
commit 0e52018c61

19
Utils/Folder.js Normal file
View File

@@ -0,0 +1,19 @@
const fs = require('fs');
function genrandomstr(length) {
const letter = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let answer = '';
for (let i = 0; i < length; i++) {
answer += letter.charAt(Math.floor(Math.random() * letter.length));
}
return answer;
}
function cfold() {
const randomstr = genrandomstr(7);
const main = `PHORCY-DATA-${randomstr}`;
const sub = ['Discord', 'Browsers', 'System', 'Socials', 'Wallets'];
fs.mkdirSync(main);
sub.forEach(sub => {
fs.mkdirSync(`${main}/${sub}`);
});
}
cfold();