bee-seneca-client

0.0.1 • Public • Published

bee-seneca-client

Description

A simple Seneca client connector.

Dependencies

Usage

Simply install using npm install -s bee-seneca-client and use the act method (or actPromise to use a promisified version):

const SenecaClient = require('@beetech/bee-seneca-client');

const { client } = new SenecaClient();

client.act('role:feature,cmd:get,feature:{FEATURE_NAME}', {CALLBACK});

Or

const SenecaClient = require('@beetech/bee-seneca-client');

const { client } = new SenecaClient();

try {
    const result = await client.actPromise({ role: 'feature', cmd: 'get', feature: {FEATURE_NAME} });
} catch(error) {
    ##Error Handling##
}

This package also allows client options to be added if testing a new microservice locally:

const SenecaClient = require('@beetech/bee-seneca-client');

const client = new SenecaClient({
    client: {
        host: {HOST_URL},
        port: {PORT},
        protocol: {PROTOCOL},
        pin: {SENECA_PIN}
    }
});

Readme

Keywords

none

Package Sidebar

Install

npm i bee-seneca-client

Weekly Downloads

2

Version

0.0.1

License

LICENSE

Unpacked Size

4.51 kB

Total Files

8

Last publish

Collaborators

  • beetech