Utils for Controllers
This package contains a set of utilities that can be used on controllers.
Usage
All functions can be imported from the package like this for example:
typescript
import { splitBooleanOutputs } from '@keload/node-red-dxp/utils/controller';And you benefit from tree-shaking in the final bundle 🚀
INFO
This documentation is automatically generated from the source code.
Functions
| Function | Description |
|---|---|
| evaluateNodeProperty | Evaluates a node property in the Node-RED environment. This function wraps the evaluateNodeProperty utility from RED.util and returns a Promise. It resolves with a tuple containing an Error (if any) and the evaluation result. |
| getREDNode | Retrieves a node by its ID from the RED.nodes collection. This function returns the node object, which includes any custom fields and credentials associated with it. If the node with the specified ID doesn't exist, the function returns null. |
| splitBooleanOutputs | Splits a message into two outputs based on a boolean condition. |
| useControllerNode | A hook-like function that provides utilities for evaluating Node-RED properties within a custom node. It includes property evaluation with default values and quick property evaluation with type enforcement. |