manidlou / node-klaw-sync

Node.js recursive synchronous fast file system walker
MIT License
157 stars 10 forks source link

Reading files only with depthLimit:0 also reads directories. #10

Closed HyperGrapher closed 6 years ago

HyperGrapher commented 6 years ago

example: const files = klawSync(os.homedir()+'/Documents', {nodir: true, depthLimit: 0});

with above line i get the file and directory names. But dir names are just truncated file path in children. result-> file.txt, dirname, dirname2 directory names are actually pointing to the files in child directories but truncated. i.e -> dirname/file-in-child.txt

Geelik commented 6 years ago

Hey, i confirm i have the same issue. So to "fix" i use a filter filter({stats}){ return stats.isFile(); }

manidlou commented 6 years ago

Sorry for the late reply! I've been so busy lately. I'll look into it. In the meantime, any help is welcome!