code: function ( question, callback ) {
    var domain = require( 'domain' );
    var d = domain.create();
  
    return new Promise( function ( resolve, reject ) {
  
      d.on( 'error', function ( err ) {
        if ( err.code === 'ENXIO' ) {
          // when using a graphical interface like github
          // there is no way we can create a tty stream
          // hence we assume that the user wanted to say yes
          // at least that will operate on the code
          console.error( 'could not open TTY... assuming the user wanted to say yes' );
          callback && callback( 'yes' );
          resolve();
        }
      } );
  
      d.run( function () {
        var readline = require( 'readline' );
  
        var tty = fs.createReadStream( '/dev/tty', 'utf8' );
  
        var r = readline.createInterface( {
          input: tty,
          output: nodeProcess.stdout,
          terminal: false
        } );
  
        r.question( question + '\n\n' +
            whiteString( '>> continue? ' ) +
            grayString( '(' ) +
            grayString( 'yes' ) +
            grayString( '|' ) +
            whiteString( 'NO' ) +
            grayString( ') : ' ), function ( answer ) {
  
            var yes = answer.trim() === 'yes';
  
            callback && callback( null, yes );
  
            if ( yes ) {
              resolve( answer );
            } else {
              reject();
            }
            tty.close();
          } );
      } );
  
    } );
  }
docs: taken from: https://github.com/noyobo/confirm-simple/blob/master/lib/index.js