title: Gulp function to create a file with contents
body: <p>I'm pretty new to gulp and trying to figure out if it's possible to write a gulp function that creates a file for me, with some content, and places the files in a location. But I'm trying to create files with the same name of other files.</p>
  <p>Here's my current setup:</p>
  <pre><code>dist
  src
  ---modules
  ------item1.njk
  ------item2.njk
  ---new files
  </code></pre>
  <p>For each file in the modules folder I want to create an .njk file with the same name but different file contents. File contents are currently HTML but I want to write new code in the newly created files.</p>
  <p><strong>Intended output:</strong></p>
  <p>src/modules/item1.njk has contents:</p>
  <pre><code>&lt;p&gt;Hello World!&lt;/p&gt;
  </code></pre>
  <p>src/modules/item2.njk has contents:</p>
  <pre><code>&lt;p&gt;Hello again, World!&lt;/p&gt;
  </code></pre>
  <p>I want these file names to be used when creating these files with new contents:</p>
  <p>src/new files/item1.njk has contents:</p>
  <pre><code>&lt;link rel=&quot;stylesheet&quot; href=&quot;../../css/styles.css&quot;&gt;
  {% block content %}
  {% include &quot;modules/item1.njk&quot; %}
  {% endblock %}
  </code></pre>
  <p>src/new files/item2.njk has contents:</p>
  <pre><code>&lt;link rel=&quot;stylesheet&quot; href=&quot;../../css/styles.css&quot;&gt;
  {% block content %}
  {% include &quot;modules/item2.njk&quot; %}
  {% endblock %}
  </code></pre>
  <p>How can I accomplish this?</p>