code: function writeFile(filename, data, options) {
      var d = Q.defer();
  
      try {
          fs.writeFileSync(filename, data, options);
      } catch(err) {
          d.reject(err);
      }
      d.resolve();
  
  
      return d.promise;
  }
docs: Write a file