title: How to search for a file with partial name in fs nodeJs
body: <p>I'm doing a fetch and download a pdf file from another server with the full file name mentioned, below is my code:</p>
  <pre><code>
  const http = require('http');
  const fs = require('fs')
  http.createServer((req, resp) =&gt; {
  
     var filename = 'AG1_LN047992593_PB_20200720'
     var url = &quot;\\\\192.168.111.71\\Passbook\\AG1_LN047992593_PB_20200720.pdf&quot;;
     
     fs.readFile(url, (err,fileContent) =&gt;
      {
        resp.writeHead(200, 
          {   'Content-Type': 'application/pdf',
              'Content-Disposition': 'attachment; filename= ' + filename + '.pdf',
         });
        console.log(err);
        resp.end(fileContent);
      });
    
    }).listen(8081);
    
    console.log('server running on port 8081');
  
  </code></pre>
  <p>here I succeeded in fetching and download that specific file mentioned in <em>filename</em> .</p>
  <p>However the next stage is to find the file with filename starts from 5th position and ends at 15th position.</p>
  <p>example - user enters the filename as <strong>LN047992593</strong> and node should search for all the files in that folder with the files names starting from  5th position and ends at 15th position and fetch and download this file - <em>AG1_LN047992593_PB_20200720.pdf</em>.</p>
  <p>There will be more than hundred thousands files in that folder with unique file names.</p>
  <p>Is there any possible way to achieve this in plain js/node code?</p>
  <p>I'm using node version <strong>6.10.0</strong></p>