get-host-context

A function that gets the context of where the applications is running and the contexts version

Installation#

npm install @iqmetrix/get-host-context

Interface#

interface HostContext {
hostName: string;
hostVersion: string;
}
const getHostContext = () => Promise<HostContext>

Example#

import getHostContext from '@iqmetrix/get-host-context';
const { hostName } = await getHostContext();
if (hostName === "Hub") {
// perform some Hub specific behaviour
} else if (hostName === "RQ") {
// perform some RQ specific behaviour
}

See tests for more examples.

Sources#

Last updated on by Paulo Andrade