function saveFile(data, fname) {
  var fs = require('fs');
  fs.writeFile(fname, JSON.stringify(data, null, 2), function (err) {
    if (err) {
      return console.error(err.message);
    }
    console.log('The data are saved in ' + fname);
  });
}
/**
 * save data to file
 * @param data    the validated json object list
 * @param fname   the file name
 */
save data to file
@param data    the validated json object list
@param fname   the file name
save data to file @param data the validated json object list @param fname the file name
function saveFile(data, fname) {
  var fs = require('fs');
  fs.writeFile(fname, JSON.stringify(data, null, 2), function (err) {
    if (err) {
      return console.error(err.message);
    }
    console.log('The data are saved in ' + fname);
  });
}
function saveFile ( data , fname ) { var fs = require ( 'fs' ) ; fs . writeFile ( fname , JSON . stringify ( data , null , 2 ) , function ( err ) { if ( err ) { return console . error ( err . message ) ; } console . log ( 'The data are saved in ' + fname ) ; } ) ; }
save data to file
 @param data    the validated json object list
 @param fname   the file name
save data to file @param data the validated json object list @param fname the file name