title: Combine JSON files with grunt-contrib-concat
body: <p>I'm looking for the best way to combine json files in a folder.</p>
  
  <p>With HTML, CSS and JavaScript this is pretty easy since you don't need a separator or only a single <code>;</code>.
  However, with JSON, we need something more to make it a valid JSON object.</p>
  
  <p>One way would be to concatenate the files with <code>,</code> and wrap everything in an array. I'm wondering if there is an better/easier way to do this.</p>
  
  <h2>Gruntfile.js</h2>
  
  <pre class="lang-js prettyprint-override"><code>grunt.initConfig({
      pkg: grunt.file.readJSON('package.json'),
      concat: {
          json: {
              src: ['src/**/*.json'],
              dest: 'dist/combined.json',
              options: {
                ...
              }
          }
      }
  });
  </code></pre>
  
  <h2>src/file1.json</h2>
  
  <pre class="lang-js prettyprint-override"><code>{
      "number": 1
  }
  </code></pre>
  
  <h2>src/file2.json</h2>
  
  <pre class="lang-js prettyprint-override"><code>{
      "number": 2
  }
  </code></pre>
  
  <h2>dist/combined.json</h2>
  
  <p>This would be the desired outcome:</p>
  
  <pre class="lang-js prettyprint-override"><code>{
      "numbers": [
          {
              "number": 1
          },
          {
              "number": 2
          }
      ]
  }
  </code></pre>