Skip to content

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 ​

FunctionDescription
evaluateNodePropertyEvaluates 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.
getREDNodeRetrieves 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.
runUserScriptCompiles and runs a user-supplied JS snippet via the AsyncFunction constructor (same family as new Function(...), but the script body may use top-level await).
splitBooleanOutputsSplits a message into two outputs based on a boolean condition.
useControllerNodeA 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.
useNodeStatusNode status helper: the text is followed by the time of the event, the fill is the one of the method.

Version v2.5.0 - Built on 2026-11-20