node-directory-tree
node-directory-tree copied to clipboard
Sort
I am thinking about making a pr for adding some sort options ,e.g. sort by date or maybe sort by name(which most of the times happens but due to this issue it is not guaranteed to happen).After all the change will not be more than ten lines and a bit of documentation maybe something like :
try {
dirData = FS.readdirSync(path);
}
goes to :
try{
dirData=FS.readdirSync(path);
if(options.sorted==="name")
dirData.sort()
else if(options.sorted==="date")
dirData.sort(dataComparer(a,b))
}
Any thoughts?
Technically it could be done, of course. Not sure of its value. Do you have a need for this? Is it too much overhead to post-process the results and sort them?
+1 Electron APP sort directory > [name ] > file > [name]
Need this feature!