Answer the question
In order to leave comments, you need to log in
How to get file directory?
getFiles('./', function (err, files) {
for (const item of getDirectories('./')) { // получит все директории
if (item.startsWith('YT')) { // оставит нужные директории
for (const item of files) {
const array = fs.readFileSync(item).toString().split("\n");
for (const item of array) {
let check = item.match(/Account (.+) Subs: (\d+)/)
if (check != null || check != undefined) {
if (Number(check[2]) > Number(limit[1])) { // ПРОВЕРКА
fska.copy('./' + item, './result/' + item, err => { // НУЖНО ПОЛУЧИТЬ ДИРЕКТОРИЮ ФАЙЛА, КОТОРЫЙ ПРОШЕЛ ПРОВЕРКУ
if(err) return console.error(err);
console.log('success!');
});
}
}
}
}
}
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question