Search code examples
javascriptfilenode.jsunixalphabetical

node.js walk a directory alphabetically recursive


Is there any way to walk a directory alphabetically but recursive?

I've been using: https://github.com/substack/node-findit to walk but it's not alphabetical.

It works based on readdir while I need something similar to php's scandir?


Solution

  • Sort the results from readdir. You can patch node-findit and use it.