the explicitly sync version of it (readDirSync). Do you mean "in parallel"?
yes readdir is already async but cant use that inside for loop. in that case how do i know when all the file paths are read coz all the readdir executed inside the for loop will read in parallel.
in regards to the Event Loop, is the sync version blocking? I know promises will freeze execution at that line and run elsewhere but not sure if sync will be the equivalent of a while(true)
Sync is blocking and equivalent to while true basically
Обсуждают сегодня