exercises/modifying_buffers/exercise.js
function query (mode) {
  var exercise = this

  function send (stream) {
    var input = through2()
    input
      .pipe(stream)
      .on('error', function(err) {
        exercise.emit(
          'fail',
          exercise.__('fail.never_read_stdin')
        )
      })
    input.write('wow. such wow.');
    input.end();
  }

  send(exercise.submissionChild.stdin)

  if (mode == 'verify')
    send(exercise.solutionChild.stdin)
}
function query (mode) {
  var exercise = this

  function send (stream) {
    var input = through2()
    input
      .pipe(stream)
      .on('error', function(err) {
        exercise.emit(
          'fail',
          exercise.__('fail.never_read_stdin')
        )
      })
    input.write('wow. such wow.');
    input.end();
  }

  send(exercise.submissionChild.stdin)

  if (mode == 'verify')
    send(exercise.solutionChild.stdin)
}
function query ( mode ) { var exercise = this function send ( stream ) { var input = through2 ( ) input . pipe ( stream ) . on ( 'error' , function ( err ) { exercise . emit ( 'fail' , exercise . __ ( 'fail.never_read_stdin' ) ) } ) input . write ( 'wow. such wow.' ) ; input . end ( ) ; } send ( exercise . submissionChild . stdin ) if ( mode == 'verify' ) send ( exercise . solutionChild . stdin ) }
delayed for 500ms to wait for servers to start so we can start playing with them
delayed for 500ms to wait for servers to start so we can start playing with them