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

Feature request - Free text search

Open martinhschei opened this issue 4 years ago • 7 comments

Thanks for creating this package which works great!

Is a search-function in the pipeline?

Could be something like this:

.search("search_for_this_string", nodeArray[]): nodes[]

martinhschei avatar Mar 05 '21 07:03 martinhschei

Hello, not sure this fits in the scope of the project. You should be able to write a function that walks the tree and uses a fuzzy search library to achieve this. What do you think?

mihneadb avatar Mar 05 '21 10:03 mihneadb

Sure - i can write it myselft but i just think it would be a nice feature in this library. It's something that i would be a lot of developers using this library would want to have right out of the box.

martinhschei avatar Mar 05 '21 11:03 martinhschei

Sounds kind of like a different library. At most perhaps the filtering functionality could be extended to support file name patterns rather than just extensions?

mihneadb avatar Mar 05 '21 11:03 mihneadb

Sure! Like i wrote in the title i would go for a "free text search" and it could also be a regex possibility. This would search on all the properties on each node.

martinhschei avatar Mar 07 '21 07:03 martinhschei

Is there a filter functionality present today?

martinhschei avatar Mar 07 '21 07:03 martinhschei

There is extension filtering as you can see in the readme.

mihneadb avatar Mar 08 '21 10:03 mihneadb

Ah - yes - i already use that one and it works great.

martinhschei avatar Mar 09 '21 07:03 martinhschei