gogo-shell-helper
Install
$ npm install --save-dev gogo-shell-helper
Usage
var gogoShell = ;var GogoShellHelper = ; var helper = GogoShellHelperstart // host: '0.0.0.0', // port: 1337, commands: command: 'test' response: 'response' command: 'multi' multiResponse: 'response1' 'response2' command: 'returns this command' ; var gogoShell = ; var config = host: '0.0.0.0' port: 1337; gogoShell ;
API
start(config)
config
type: object
config.commands
type: array
An array of objects containing mock commands
commands: command: 'test' response: 'response'
If response
is omitted, it will return the command
value. multiResponse
is intended for an array of values that will be joined and returned.
config.host
type: string
config.port
type: string
setCommands(commands)
commands
type: array
Overwrites the commands
property set in the constructor.
addCommand(command)
type: object
Adds command to commands
array.