title: How to find all files in one directory that match files in other directory in gulp using del?
body: <p>Basically, as part of my clean task, I'd like to delete in the root folder all files that are present in my src folder, automatically. Because there are files in the root that aren't in src, I can't just delete all of them, and I'd like to keep the process dynamic (automatically determine matching files) rather than manual (explicitly listing the files to delete).</p>
  
  <p>Right now, I'm doing this manually:</p>
  
  <pre><code>const deleteViewFiles = done =&gt; {
    del.sync([
      './page-*.php',
      './header.php',
    ]);
    done();
  }
  </code></pre>
  
  <p>But what I'd like is, look at <code>./src/views/</code>, find all direct descendants of <code>./src/views/</code> (not subfolders), and delete them at the root.</p>
  
  <p>eg. Let's say in <code>./src/views/</code> I have <code>page-1.php</code>, <code>header.php</code>, <code>my-dog.php</code>, <code>mermaid.html</code>, I want to delete all those files from root without listing them in my delete task. </p>