lib/bagofcli.js
function exit(err, result) {
  if (err) {
    console.error(colors.red(err.message || JSON.stringify(err)));
    process.exit(1);
  } else {
    process.exit(0);
  }
}
function exit(err, result) {
  if (err) {
    console.error(colors.red(err.message || JSON.stringify(err)));
    process.exit(1);
  } else {
    process.exit(0);
  }
}
function exit ( err , result ) { if ( err ) { console . error ( colors . red ( err . message || JSON . stringify ( err ) ) ) ; process . exit ( 1 ) ; } else { process . exit ( 0 ) ; } }
Handle process exit based on the existence of error.
This is handy for command-line tools to use as the final callback.
Exit status code 1 indicates an error, exit status code 0 indicates a success.
Error message will be logged to the console. Result object is only used for convenient debugging.

@param {Error} err: error object existence indicates the occurence of an error
@param {Object} result: result object
Handle process exit based on the existence of error . This is handy for command - line tools to use as the final callback . Exit status code 1 indicates an error exit status code 0 indicates a success . Error message will be logged to the console . Result object is only used for convenient debugging .