Node.Js: How to limit files recovered by fs.readdirSync?
I have a lot of folders. each folder has thousands of files.
I am using fs.readdirSync () to list all the files in a folder.
I need to limit this list to a specific number of files.
let's say to get 100 files just at a time.
is it doable?
to make everything work. I used a slice.
if(currentFiles.length > 100){
currentFiles = currentFiles.slice(0,100);
}
+3
Ahmed metwally
source
to share
No one has answered this question yet
Check out similar questions:
2237
2201
1648
1517
1500
1388
1264
1116
1045
890