title: Multiple writeFile in NodeJS
body: <p>I have a task to write parts of the data to separate files:</p>
  
  <pre><code>        fs.writeFile('content/a.json', JSON.stringify(content.a, null, 4), function(err) {
              if(err) {
                  console.log(err);
              } else {
                  console.log('a.json was updated.');
              }
          });
          fs.writeFile('content/b.json', JSON.stringify(content.b, null, 4), function(err) {
              if(err) {
                  console.log(err);
              } else {
                  console.log('b.json was updated.');
              }
          });
          fs.writeFile('content/c.json', JSON.stringify(content.c, null, 4), function(err) {
              if(err) {
                  console.log(err);
              } else {
                  console.log('c.json was updated.');
              }
          });
          fs.writeFile('content/d.json', JSON.stringify(content.d, null, 4), function(err) {
              if(err) {
                  console.log(err);
              } else {
                  console.log('d.json was updated.');
              }
          });
  </code></pre>
  
  <p>But now I have 4 different callbacks, so I can't get the moment, when all 4 task have been finished. Is it possible to parallel 4 writeFile calls and get only 1 callback, which will be called when 4 files was created?</p>
  
  <p>P.S.</p>
  
  <p>Of course I can do smth like:</p>
  
  <pre><code>fs.writeFile('a.json', data, function(err) {
    fs.writeFile('b.json', data, function(err) {
      ....
      callback();
    }
  }
  </code></pre>
  
  <p>Just curious is there any other way to do this. Thanks.</p>