0.0.1 • Published 4 years ago

bee-seneca-client v0.0.1

Weekly downloads
6
License
LICENSE
Repository
github
Last release
4 years ago

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}
    }
});
0.0.1

4 years ago