ssp-client
A simple client for the Simple Server Protocol (SSP) written in typescript.
Implements the API described here and here.
See the SSP repo for further details about SSP.
Installing
npm i ssp-client
Usage
Basic "short" usage example, for full list of available methods, see usage.
; // Use the host and port your SSP server is running on; // Initiate the connectionawait client.connect; // Find suitable server in a directory and use the serverBeans to create a server called myServer;; // Alternatively, one can create a server directly from a path; // All 'sync' methods have an async alternative, in order to see when it completes, subscribe to the appropriate eventclient.onServerAdded;await client.createServerAsync'path/to/server', 'server'; // Starting a server:// subscribe to the server producing outputclient.onServerOutputAppended; // subscribe to server state changes to see when it started/stoppedclient.onServerStateChange; // get the starting parameters, we are using the normal run mode here;; // finally start the serverawait client.startServerAsyncparams; // Stopping a server, use force at your willawait client.stopServerAsync; // When all is done you can disconnect the clientclient.disconnect;// or even shut down the entire SSP server instead - don't use disconnect in this caseclient.shutdownServer;
Running unit tests
Unit tests are located in test
. To run all unit tests:
npm run test
publish
To publish our module, run the command
npm publish
Build
npm run build