soldair / node-walkdir

Walk a directory tree emitting events based on the contents. API compatable with node-findit. Walk a tree of any depth. Fast! Handles permission errors. Stoppable. windows support. Pull requests are awesome. watchers are appreciated.
MIT License
131 stars 22 forks source link

Folder sorting... #32

Closed kaanuki closed 6 years ago

kaanuki commented 7 years ago

If it's not currently supported, I'd like to recommend a feature that allows walkdir to sort the list of folders and files found.

Walkdir is currently displaying my items in a random order, but I'd like them displayed alphabetically, as they are in the folder. I've tried '.serialize', but it does to work either.

Any recommendations in the mean time?

Thanks in advance.

soldair commented 6 years ago

you can add them to an array in sorted position or sort the array after you have the list of files. its going to be in random order based on the speed of your file system.