node-directory-tree icon indicating copy to clipboard operation
node-directory-tree copied to clipboard

Sort

Open SpyrosMourelatos opened this issue 4 years ago • 2 comments

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?

SpyrosMourelatos avatar Apr 26 '21 08:04 SpyrosMourelatos

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?

mihneadb avatar May 04 '21 13:05 mihneadb

+1 Electron APP sort directory > [name ] > file > [name]

Need this feature!

aolsx avatar Oct 16 '21 21:10 aolsx