node-red-contrib-calculate is a Node-RED contribution package providing nodes for performing simple calculations like average, maximum, minimum, and median over a specified time period or message count. It is currently at version 0.1.4. The package appears to have an infrequent release cadence, with the last update more than six years ago, suggesting it is no longer actively maintained. Its key differentiator lies in its straightforward configuration within the Node-RED visual editor for basic aggregate computations, contrasting with more general-purpose `function` nodes or other calculation-oriented nodes that might offer broader mathematical operations but require more complex setup.
npm install node-red-contrib-calculateVerified import paths — ran on the pinned version, not inferred.
This Node-RED flow demonstrates various calculation nodes (average, median, min, max) configured to process random numbers either every minute or every 10 messages, outputting the results to a debug node. This can be imported directly into Node-RED's 'Import' menu.
Consider using alternative, actively maintained Node-RED calculation nodes such as `node-red-contrib-calc` or `node-red-contrib-statistics` for better compatibility and ongoing support.
Audit the package's `node_modules` for vulnerable dependencies using tools like `npm audit`. Prioritize migrating to actively maintained alternatives that receive regular security updates.
Thoroughly test the node's behavior with realistic message loads and timing scenarios. Monitor Node-RED's memory usage and output frequency in development to ensure stable operation. Adjust `pauseType`, `timeout`, and `rate` settings based on observed performance and requirements.
Plan for migration to more robust and actively developed Node-RED calculation or statistics nodes for any critical applications. Examples include `node-red-contrib-calc` or `node-red-contrib-statistics`.
Run `npm install node-red-contrib-calculate` in your Node-RED user directory (typically `~/.node-red`) and then restart Node-RED. Verify the node appears in the palette.
Ensure Node-RED is completely restarted after installation. Check the Node-RED console logs for any errors during startup. You can also try clearing the Node-RED cache or reinstalling the package.