lib/shortline.js
function Shortline(options) {
  const self = this;

  self._input = (options && options.input) || process.stdin;
  self._output = (options && options.output) || process.stderr;

  /** Most recent error emitted by the input stream.
   * @type {Error}
   */
  self.inputError = null;
  self._input.on('end', () => {
    self.inputError = new EOFError(EOF_MESSAGE);
  });
  // Note:  Can't listen for 'error' since it changes behavior if there are no
  // other listeners.  Listen for it only when reading from input (since that
  // is our error and will be returned to the caller).
}
function Shortline(options) {
  const self = this;

  self._input = (options && options.input) || process.stdin;
  self._output = (options && options.output) || process.stderr;

  /** Most recent error emitted by the input stream.
   * @type {Error}
   */
  self.inputError = null;
  self._input.on('end', () => {
    self.inputError = new EOFError(EOF_MESSAGE);
  });
  // Note:  Can't listen for 'error' since it changes behavior if there are no
  // other listeners.  Listen for it only when reading from input (since that
  // is our error and will be returned to the caller).
}
Creates a new instance of Shortline which can be used to prompt users
for input.

This class is intended to be similar to {@link http://highline.rubyforge.org
Highline}, although it is currently missing nearly all of its functionality.

@constructor
@param {{
input: stream.Readable|undefined,
output: stream.Writable|undefined
}=} options Options to control the input source and output destination.