lib/generate-fountainhead-data.js
function saveObjectToJSON(filePath, data) {
    try {
      data = JSON.stringify(data, null, 2);
      writeFileSync(filePath, data, { encoding: 'utf8' });
      return true;
    } catch(ex) {
      console.warn('Unable to save class JSON');
      return false;
    }

    // NOTE: ASYNC REQUIRES PROMISIFYING ALL OPERATIONS
    // fs.writeFile(filePath, data, err => {
    //   if (err) { console.warn(`Unable to save ${filePath}`); }
    // });
  }
function saveObjectToJSON(filePath, data) {
    try {
      data = JSON.stringify(data, null, 2);
      writeFileSync(filePath, data, { encoding: 'utf8' });
      return true;
    } catch(ex) {
      console.warn('Unable to save class JSON');
      return false;
    }

    // NOTE: ASYNC REQUIRES PROMISIFYING ALL OPERATIONS
    // fs.writeFile(filePath, data, err => {
    //   if (err) { console.warn(`Unable to save ${filePath}`); }
    // });
  }
function saveObjectToJSON ( filePath , data ) { try { data = JSON . stringify ( data , null , 2 ) ; writeFileSync ( filePath , data , { encoding : 'utf8' } ) ; return true ; } catch ( ex ) { console . warn ( 'Unable to save class JSON' ) ; return false ; } // NOTE: ASYNC REQUIRES PROMISIFYING ALL OPERATIONS // fs.writeFile(filePath, data, err => { //   if (err) { console.warn(`Unable to save ${filePath}`); } // }); }
Call to handle saving data to a file. Requires a file path and data to save.
If data is not a string, it will be stringified
@method saveObjectToJSON
@param {string}        filePath Path to save file at
@param {Object|string} data     Data to save in file
@return {boolean} True for successful operation, false for failures
Call to handle saving data to a file . Requires a file path and data to save . If data is not a string it will be stringified