D3 Mitch Tree add Filter and Search Functionality

I am building a heirarchy tree that needs to be filterable and searchable. I am using D3 Mitch tree – https://d3-mitch-tree.netlify.app/

Right now I handle he filtering by

    document.getElementById('focusButton').addEventListener('click', function(){
    var value = 'filter1';
    var nodeMatchingText = treePlugin.getNodes().find(function(node){
    return node.data.name == value;    
    });
    treePlugin.focusToNode(nodeMatchingText);  
      
    });```


Then in the data json the name would have to be filter1 to make this match, and then it would open and focus on that node. This works, however I would like it to open all of the children related to that node. 

Search is where I am really struggling, I need it to do a full match or starts with or even partial on the names and then open ALL nodes that have the match in their children and close any that don't .

Currently I have this which will only open and focus on the first if it is an exact match. In the console log statement I can see all of the nodes but I am not sure how to get it to return and open those nodes.

document.getElementById('focusButton-search').addEventListener('click', function(){
var value = document.getElementById('search').value;
var nodeMatchingText = treePlugin.getNodes().find(function(node){
return node.data.name == value;
});
console.log(nodeMatchingText);
treePlugin.focusToNode(nodeMatchingText);

});