async function doCommand(prompt, callback) {
  if (prompt) {
    const code = await promptly.prompt(prompt, { silent: true });
    if (code !== process.env.ADMIN_CODE) {
      console.log('Invalid admin code.');
      process.exit(0);
    }
  }

  mongoose.connect(process.env.MONGODB_URI, mongooseConnectionOptions);
  const db = mongoose.connection;
  db.once('open', callback);
}
/**
 * Prompt for admin code then connect and run command
 *
 * @param {String|false} prompt Prompt text or false to skip
 * @param {Func} callback Callback function is responsible for exiting the process
 * @param {Bool} Return true or exit if invalid admin code
 */
Prompt for admin code then connect and run command
@param {String|false} prompt Prompt text or false to skip
@param {Func} callback Callback function is responsible for exiting the process
@param {Bool} Return true or exit if invalid admin code
Prompt for admin code then connect and run command @param { String|false } prompt Prompt text or false to skip @param { Func } callback Callback function is responsible for exiting the process @param { Bool } Return true or exit if invalid admin code
async function doCommand(prompt, callback) {
  if (prompt) {
    const code = await promptly.prompt(prompt, { silent: true });
    if (code !== process.env.ADMIN_CODE) {
      console.log('Invalid admin code.');
      process.exit(0);
    }
  }
  mongoose.connect(process.env.MONGODB_URI, mongooseConnectionOptions);
  const db = mongoose.connection;
  db.once('open', callback);
}
async function doCommand ( prompt , callback ) { if ( prompt ) { const code = await promptly . prompt ( prompt , { silent : true } ) ; if ( code !== process . env . ADMIN_CODE ) { console . log ( 'Invalid admin code.' ) ; process . exit ( 0 ) ; } } mongoose . connect ( process . env . MONGODB_URI , mongooseConnectionOptions ) ; const db = mongoose . connection ; db . once ( 'open' , callback ) ; }
Prompt for admin code then connect and run command
 @param {String|false} prompt Prompt text or false to skip
 @param {Func} callback Callback function is responsible for exiting the process
 @param {Bool} Return true or exit if invalid admin code
Prompt for admin code then connect and run command @param { String|false } prompt Prompt text or false to skip @param { Func } callback Callback function is responsible for exiting the process @param { Bool } Return true or exit if invalid admin code