Class: SshCommand

SshCommand

A command with data.


new SshCommand(command [, data])

Constructor.

Parameters:
Name Type Argument Description
command string

the command

data * <optional>

optional data to associate with the command

Methods


<static> fromJsonEncoding(json [, dataParser])

Parse a JSON string into a module:domain~SshCommand instance.

The JSON must be encoded the same way module:domain~SshCommand#toJsonEncoding does.

Parameters:
Name Type Argument Description
json string

the JSON to parse

dataParser function <optional>

if provided, a function that accepts a string of JSON and returns an object representation of that data; if not provided then a simple object parsed via JSON.parse() will be used

Returns:

the command instance

Type
module:domain~SshCommand

toJsonEncoding()

Get this object as a standard JSON encoded string value.

If data has a toJsonEncoding() function, that will be invoked and used in the result. Otherwise the data object will be serialized to JSON via JSON.stringify().

Returns:

the JSON encoded string

Type
string