gogo-shell
A Node wrapper for sending Gogo commands to an OSGi environment
Install
$ npm install --save gogo-shell
Usage
Note: a Gogo shell must be running before invoking the connect method, otherwise a connection error will be thrown.
var GogoShell = ; var gogoShell = ; var config = port: 11311; gogoShell ;
API
GogoShell is an instance of net.Socket and inherits all it's properties, methods, and events.
new GogoShell([options])
options
Type: object
The GogoShell
constructor can also be passed the same configuration options as the net.Socket constructor.
debug
type: boolean
If set to true, prints all commands sent to the server, and all response data from the server to stdout.
examples
var GogoShell = ; var gogoShell = debug: true;
connect([options])
Connects to a TCP server which allows you to send Gogo commands to an OSGi environment. Returns a Promise which resolves when the server is ready to receive commands.
options
Type: object
host
Type: string
Default: 127.0.0.1
port
Type: number
Required: true
See socket.connect method for other options and their default values.
examples
var GogoShell = ; var gogoShell = ; var config = port: 11311; gogoShell ;
help([command])
Returns Promise that resolves with array of available commands, or object literal containing information on specified command.
command
Type: string
The Gogo command to retieve help info for.
examples
gogoShell ;
gogoShell ;
sendCommand(command, [options])
Sends Gogo command to an OSGi environment. Returns a Promise that resolves with the response data.
command
Type: string
The Gogo command that will be sent to the OSGi environment.
options
Type: string
Additional parameters, flags, and options that will be joined with the command argument.
examples
gogoShell ;
Chaining commands.
var GogoShell = ; var gogoShell = ; var config = port: 11311; gogoShell ;
MIT