Command line tool for developers to send messages to Seneca based applications
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
src
.gitignore
LICENSE
README.md
package-lock.json
package.json

README.md

talk-to-seneca (tts)

A simple tool for developers to test Seneca based applications by sending messages to them interactively.

Installation

npm install -g talk-to-seneca

Usage

Run tts:

tts
TTS [disconnected] >

Get command help:

TTS [disconnected] > help

  Commands:

    help [command...]        Provides help for a given command.
...

Configure a client:

TTS [disconnected] > client tcp -p 3003
Client id 0 configured.
TTS [1 client] > show client 0
Client id 0:  { type: 'tcp', host: 'localhost', port: 3003, pin: undefined }
TTS [1 client] >

Configure an AMQP client:

TTS [disconnected] > client amqp --pin role:*
Client id 0 configured.
TTS [1 client] > show client 0
Client id 0:  { type: 'amqp',
  host: 'localhost',
  port: 5672,
  pin: 'role:*',
  socketOptions: { noDelay: true } }
TTS [1 client] > 

Send a message (act):

TTS [1 client] > act role:validation, domain: entity, cmd: validateOne, instance: { int1: 42, int2: 100, string: something , date1: '2017-09-12T12:57:47.825Z', date2: '2017-09-12T12:57:47.825Z' }
Result:  {
  "valid": true
}
TTS [1 client] > 

The string following the act command is passed to Seneca's act function, which interprets it using jsonic.

Error and result information that are received as a response to the message are output directly (Result in the sample).

Status

The tool has just been created. There are some outstanding issues and lots of ideas for improvement. Please feel free to suggest anything or submit pull requests.