code: function(output_filename, given_json, given_options) {
  
      var options = given_options || 'utf8';
  
      var json_as_string = JSON.stringify(given_json); // convert json into string
  
      try {
  
          fs.writeFileSync(output_filename, json_as_string, options); // or async : writeFile
  
      } catch (err) {
  
              console.log(err);
              process.exit(8);
      };
  
      // console.log("just wrote to output file ", output_filename);
  }
docs: ---