lib/vorpal.js
function Vorpal() {
  if (!(this instanceof Vorpal)) {
    return new Vorpal();
  }

  // Program version
  // Exposed through vorpal.version(str);
  this._version = '';

  // Program title
  this._title = '';

  // Program description
  this._description = '';

  // Program baner
  this._banner = '';

  // Command line history instance
  this.cmdHistory = new this.CmdHistoryExtension();

  // Registered `vorpal.command` commands and
  // their options.
  this.commands = [];

  // Queue of IP requests, executed async, in sync.
  this._queue = [];

  // Current command being executed.
  this._command = undefined;

  // Expose UI.
  this.ui = ui;

  // Expose chalk as a convenience.
  this.chalk = chalk;

  // Expose lodash as a convenience.
  this.lodash = _;

  // Exposed through vorpal.delimiter(str).
  this._delimiter = 'local@' + String(os.hostname()).split('.')[0] + '~$ ';
  ui.setDelimiter(this._delimiter);

  // Placeholder for vantage server. If vantage
  // is used, this will be over-written.
  this.server = {
    sessions: []
  };

  // Whether all stdout is being hooked through a function.
  this._hooked = false;

  this._useDeprecatedAutocompletion = false;

  // Expose common utilities, like padding.
  this.util = VorpalUtil;

  this.Session = Session;

  // Active vorpal server session.
  this.session = new this.Session({
    local: true,
    user: 'local',
    parent: this,
    delimiter: this._delimiter
  });

  // Allow unix-like key value pair normalization to be turned off by toggling this switch on.
  this.isCommandArgKeyPairNormalized = true;

  this._init();
  return this;
}
function Vorpal() {
  if (!(this instanceof Vorpal)) {
    return new Vorpal();
  }

  // Program version
  // Exposed through vorpal.version(str);
  this._version = '';

  // Program title
  this._title = '';

  // Program description
  this._description = '';

  // Program baner
  this._banner = '';

  // Command line history instance
  this.cmdHistory = new this.CmdHistoryExtension();

  // Registered `vorpal.command` commands and
  // their options.
  this.commands = [];

  // Queue of IP requests, executed async, in sync.
  this._queue = [];

  // Current command being executed.
  this._command = undefined;

  // Expose UI.
  this.ui = ui;

  // Expose chalk as a convenience.
  this.chalk = chalk;

  // Expose lodash as a convenience.
  this.lodash = _;

  // Exposed through vorpal.delimiter(str).
  this._delimiter = 'local@' + String(os.hostname()).split('.')[0] + '~$ ';
  ui.setDelimiter(this._delimiter);

  // Placeholder for vantage server. If vantage
  // is used, this will be over-written.
  this.server = {
    sessions: []
  };

  // Whether all stdout is being hooked through a function.
  this._hooked = false;

  this._useDeprecatedAutocompletion = false;

  // Expose common utilities, like padding.
  this.util = VorpalUtil;

  this.Session = Session;

  // Active vorpal server session.
  this.session = new this.Session({
    local: true,
    user: 'local',
    parent: this,
    delimiter: this._delimiter
  });

  // Allow unix-like key value pair normalization to be turned off by toggling this switch on.
  this.isCommandArgKeyPairNormalized = true;

  this._init();
  return this;
}
function Vorpal ( ) { if ( ! ( this instanceof Vorpal ) ) { return new Vorpal ( ) ; } // Program version // Exposed through vorpal.version(str); this . _version = '' ; // Program title this . _title = '' ; // Program description this . _description = '' ; // Program baner this . _banner = '' ; // Command line history instance this . cmdHistory = new this . CmdHistoryExtension ( ) ; // Registered `vorpal.command` commands and // their options. this . commands = [ ] ; // Queue of IP requests, executed async, in sync. this . _queue = [ ] ; // Current command being executed. this . _command = undefined ; // Expose UI. this . ui = ui ; // Expose chalk as a convenience. this . chalk = chalk ; // Expose lodash as a convenience. this . lodash = _ ; // Exposed through vorpal.delimiter(str). this . _delimiter = 'local@' + String ( os . hostname ( ) ) . split ( '.' ) [ 0 ] + '~$ ' ; ui . setDelimiter ( this . _delimiter ) ; // Placeholder for vantage server. If vantage // is used, this will be over-written. this . server = { sessions : [ ] } ; // Whether all stdout is being hooked through a function. this . _hooked = false ; this . _useDeprecatedAutocompletion = false ; // Expose common utilities, like padding. this . util = VorpalUtil ; this . Session = Session ; // Active vorpal server session. this . session = new this . Session ( { local : true , user : 'local' , parent : this , delimiter : this . _delimiter } ) ; // Allow unix-like key value pair normalization to be turned off by toggling this switch on. this . isCommandArgKeyPairNormalized = true ; this . _init ( ) ; return this ; }
Initialize a new `Vorpal` instance.

@return {Vorpal}
@api public
Initialize a new Vorpal instance .