title: How to pass folders and files to a node.js based CLI?
body: <p>I'm working on a CLI that is based in TS/node.js</p>
  <p>The CLI is called bunk and I want to pass it arguments like</p>
  <p><code>bunk --input folder1 file1.txt file2.txt file3.txt --output result.txt</code></p>
  <p>I have a basic version of it working, like <code>bunk filename1.txt</code></p>
  <p>but I'm not sure how to process something like <code>--input folder1 file1</code></p>
  <p>and get files inside folder1 ending with the extension .txt and running functions on them.</p>
  <p>I'm using this to iterate over the arguments</p>
  <pre><code>process.argv[i]
  </code></pre>
  <p>and then using readFileSync on that.</p>
  <p>Any help would be really appreciated!</p>