Skip to content
dc edited this page Jan 26, 2016 · 1 revision

Vorpal extends EventEmitter.prototype. Simply use vorpal.on('event', fn) and vorpal.emit('event', data). The following events are supported:

  • command_registered: Fires when vorpal.command registers a new command.

  • keypress: Fires on keypress on local client terminal. Passes an object with the following keys to the listener:

{"key": <the letter corresponding to the key, or the name of the key, 'up', 'down' etc>,
 "value": <the current value of prompt>,
 "e": <the event object>}
  • client_prompt_submit: Fires when the CLI prompt has been submitted with a command, including ''. Passes a single argument to the listener: the submitted command, as string.

  • client_command_executed: Fires at the client once the command has been received back as executed.

  • client_command_error: Fires at the client if a command comes back with an error thrown.

Clone this wiki locally