function writeJSONToFile(obj, path) {
  // Convert JSON object to a string
  const data = JSON.stringify(obj);

  // Attempt to write file to disk
  fs.writeFile(path, data, "utf8", (err) => {
    if (err) {
      console.error(`Error writing data to ${path}: ${err}`);
    } else {
      console.info(`Successfully wrote data to ${path}!`);
    }
  });
}
/**
 * Write a JSON object to the file system.
 *
 * @since       1.0.0
 * @access      public
 *
 * @param {Object} obj  The JSON object to save.
 * @param {string} path The path of the system file to write to.
 */
Write a JSON object to the file system.

@param {Object} obj  The JSON object to save.
@param {string} path The path of the system file to write to.
Write a JSON object to the file system . @param { Object } obj The JSON object to save . @param { string } path The path of the system file to write to .
function writeJSONToFile(obj, path) {
  const data = JSON.stringify(obj);
  fs.writeFile(path, data, "utf8", (err) => {
    if (err) {
      console.error(`Error writing data to ${path}: ${err}`);
    } else {
      console.info(`Successfully wrote data to ${path}!`);
    }
  });
}
function writeJSONToFile ( obj , path ) { const data = JSON . stringify ( obj ) ; fs . writeFile ( path , data , "utf8" , ( err ) => { if ( err ) { console . error ( ` ${ path } ${ err } ` ) ; } else { console . info ( ` ${ path } ` ) ; } } ) ; }
Write a JSON object to the file system.
Write a JSON object to the file system .
// Convert JSON object to a string // Attempt to write file to disk