简体   繁体   English

node.js按字母顺序遍历目录

[英]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. 我一直在使用: https : //github.com/substack/node-findit走路,但这不是字母顺序的。

It works based on readdir while I need something similar to php's scandir? 它基于readdir工作,而我需要类似于php的scandir吗?

Sort the results from readdir. 从readdir排序结果。 You can patch node-findit and use it. 您可以修补并使用node-findit。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM