GrexxConnect External System Service (ESS) Helper
Install
npm install grexxconnect-ess --save
Example
"use strict";
const EssConnect = require('grexxconnect-ess');
const GrexxConnectEss = new EssConnect({
applicationName: "My Custom ESS v2.4",
username: "John",
password: "JohnsPassword",
server: "wss://server.com"
});
GrexxConnectEss.on('message', Message => {
console.info('Received a message', Message.parsed, Message.content);
const reversedValue = (Message.parsed.content || '').split("").reverse().join("");
Message.resolve([{
reference: 'outputField',
values: [{ value: reversedValue }]
}])
});
GrexxConnectEss.on('connected', () => console.info('Connected!'));
GrexxConnectEss.on('authorized', serviceName => console.info('Authorized!', serviceName));
GrexxConnectEss.on('disconnected', () => console.info('Disconnected!'));
GrexxConnectEss.on('error', error => console.error('Error: ', error));