{"id":14741,"library":"node-red-contrib-calculate","title":"Node-RED Calculate Node","description":"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.","status":"abandoned","version":"0.1.4","language":"javascript","source_language":"en","source_url":"https://github.com/obrut/node-red-contrib-calculate","tags":["javascript","node-red","calculating","average","max","min","median","delay","messagecount"],"install":[{"cmd":"npm install node-red-contrib-calculate","lang":"bash","label":"npm"},{"cmd":"yarn add node-red-contrib-calculate","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-red-contrib-calculate","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This is a Node-RED 'contrib' package, meaning it provides nodes to be used within the Node-RED runtime and editor. Node-RED itself is the core platform dependency.","package":"node-red","optional":false}],"imports":[{"note":"This package provides nodes for the Node-RED visual editor, not JavaScript functions for direct programmatic import. Once installed, the 'calculate' node becomes available in the Node-RED palette under the 'data-and-analytics' category.","wrong":"import { Calculate } from 'node-red-contrib-calculate'; // Incorrect: This is a Node-RED palette node, not a programmatic library. \nconst calculateNode = require('node-red-contrib-calculate'); // Incorrect: Not directly consumable via CommonJS require.","symbol":"Calculate Node","correct":"Install via Node-RED Palette Manager: Search for 'node-red-contrib-calculate' and click install. Alternatively, run `npm install node-red-contrib-calculate` in your Node-RED user directory."}],"quickstart":{"code":"[{\"id\":\"4c3a1551.6c254c\",\"type\":\"random\",\"z\":\"aff2cc18.0b484\",\"name\":\"RandomNumber\",\"low\":\"1\",\"high\":\"100\",\"inte\":\"true\",\"property\":\"payload\",\"x\":340,\"y\":300,\"wires\":[[\"6f127280.30cf3c\",\"6867669e.2a13a8\",\"ac90cf81.6e61b\",\"6dd3b70c.dfd938\",\"596e1e94.3205b\"]]},{\"id\":\"6f127280.30cf3c\",\"type\":\"calculate\",\"z\":\"aff2cc18.0b484\",\"name\":\"AvgEveryMinute\",\"pauseType\":\"timed\",\"calculation\":\"average\",\"timeout\":\"1\",\"timeoutUnits\":\"minutes\",\"rate\":\"10\",\"x\":600,\"y\":180,\"wires\":[[\"4fb1838b.89fb2c\"]]},{\"id\":\"b32574cf.036708\",\"type\":\"inject\",\"z\":\"aff2cc18.0b484\",\"name\":\"10SecBump\",\"topic\":\"\",\"payload\":\"\",\"payloadType\":\"date\",\"repeat\":\"10\",\"crontab\":\"\",\"once\":true,\"onceDelay\":0.1,\"x\":140,\"y\":300,\"wires\":[[\"4c3a1551.6c254c\"]]},{\"id\":\"6867669e.2a13a8\",\"type\":\"calculate\",\"z\":\"aff2cc18.0b484\",\"name\":\"AvgEvery10Msg\",\"pauseType\":\"rate\",\"calculation\":\"average\",\"timeout\":\"10\",\"timeoutUnits\":\"seconds\",\"rate\":\"10\",\"x\":600,\"y\":240,\"wires\":[[\"4fb1838b.89fb2c\"]]},{\"id\":\"ac90cf81.6e61b\",\"type\":\"calculate\",\"z\":\"aff2cc18.0b484\",\"name\":\"MedEveryMinute\",\"pauseType\":\"timed\",\"calculation\":\"median\",\"timeout\":\"1\",\"timeoutUnits\":\"minutes\",\"rate\":\"10\",\"x\":610,\"y\":320,\"wires\":[[\"4fb1838b.89fb2c\"]]},{\"id\":\"6dd3b70c.dfd938\",\"type\":\"calculate\",\"z\":\"aff2cc18.0b484\",\"name\":\"MinEveryMinute\",\"pauseType\":\"timed\",\"calculation\":\"min\",\"timeout\":\"1\",\"timeoutUnits\":\"minutes\",\"rate\":\"10\",\"x\":600,\"y\":380,\"wires\":[[\"4fb1838b.89fb2c\"]]},{\"id\":\"596e1e94.3205b\",\"type\":\"calculate\",\"z\":\"aff2cc18.0b484\",\"name\":\"MaxEveryMinute\",\"pauseType\":\"timed\",\"calculation\":\"max\",\"timeout\":\"1\",\"timeoutUnits\":\"minutes\",\"rate\":\"10\",\"x\":610,\"y\":440,\"wires\":[[\"4fb1838b.89fb2c\"]]},{\"id\":\"4fb1838b.89fb2c\",\"type\":\"debug\",\"z\":\"aff2cc18.0b484\",\"name\":\"Debug\",\"active\":false,\"tosidebar\":true,\"console\":false,\"tostatus\":false,\"complete\":\"payload\",\"targetType\":\"msg\",\"x\":870,\"y\":300,\"wires\":[]}]","lang":"json","description":"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."},"warnings":[{"fix":"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.","message":"This package (v0.1.4) has not been updated in over six years and may not be compatible with newer versions of Node.js or Node-RED, potentially causing runtime errors or unexpected behavior.","severity":"breaking","affected_versions":"<=0.1.4"},{"fix":"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.","message":"Being unmaintained, this package may contain outdated dependencies with known security vulnerabilities (CVEs). Deploying it in production environments without thorough security auditing is not recommended.","severity":"gotcha","affected_versions":"<=0.1.4"},{"fix":"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.","message":"The `timeout` and `rate` configurations require careful tuning. If messages arrive too quickly or slowly relative to the configured time period or message count, the node might not output results as expected, or could accumulate excessive memory if not released.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"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`.","message":"The package's low version number (0.1.4) and lack of updates for an extended period indicate it's effectively abandoned. While it might still function for basic tasks, it's not receiving new features, bug fixes, or performance improvements.","severity":"deprecated","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"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.","cause":"The package was not correctly installed into the Node-RED user directory, or Node-RED was not restarted after installation.","error":"Error: Cannot find module 'node-red-contrib-calculate'"},{"fix":"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.","cause":"Node-RED may not have picked up the new node, possibly due to an incomplete installation, caching issues, or a conflicting package.","error":"Node-RED palette does not show the 'calculate' node after installation."}],"ecosystem":"npm"}