Registry / data / node-red-node-smooth

node-red-node-smooth

JSON →
library0.1.2jsnpmunverified

node-red-node-smooth is a Node-RED package providing a collection of simple smoothing algorithms for processing incoming numerical data. It includes functions like Minimum, Maximum, Mean, Standard Deviation, High Pass, and Low Pass smoothing. The current stable version, 0.8.0, was released approximately a year ago, indicating an active but not rapid release cadence. This node is specifically designed for the Node-RED environment, a low-code programming platform for event-driven applications, differentiating it from general-purpose JavaScript libraries. Its primary strength lies in its direct integration into Node-RED flows, allowing users to easily incorporate data smoothing into their visual programming logic without writing complex code. It operates exclusively on numerical inputs and can reset its internal state via a `msg.reset` message.

npm install node-red-node-smooth
INSTALL
IMPORT
SIG · NODE-RED-NODE-SMOO
N
node-red-node-smooth
datajavascriptv0.1.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Node-RED Node (Smooth)
Install via npm: npm install node-red-node-smooth Then add 'smooth' node from the palette in Node-RED editor.
import { smooth } from 'node-red-node-smooth'
Node-RED nodes are not imported into standard JavaScript files directly for use. They are installed via npm into the Node-RED user directory, which then makes them available in the Node-RED editor's palette for graphical use. They represent runtime functions within the Node-RED flow engine.
Node-RED Node Definition
// In a custom Node-RED node .js file (e.g., ~/.node-red/nodes/my-smooth-node.js) module.exports = function(RED) { function SmoothNode(config) { RED.nodes.createNode(this, config); // ... node logic ... } RED.nodes.registerType('smooth', SmoothNode); }
require('node-red-node-smooth')
While Node-RED nodes are Node.js modules that export a function, directly `require()`-ing the `node-red-node-smooth` package in user code is not how its functionality is typically consumed. Developers interact with the node definition `module.exports = function(RED){...}` when *creating* a new Node-RED node type, not when *using* an existing one.

This quickstart demonstrates how to install the node-red-node-smooth package and integrate its smoothing functionality into a basic Node-RED flow for processing data.

npm install node-red-node-smooth # After installation, restart Node-RED if it's running. # Open your Node-RED editor (usually at http://localhost:1880). # Drag the 'smooth' node from the palette (under 'function' or 'data-and-analytics' category) onto your flow. # Configure the node by double-clicking it, selecting a smoothing algorithm (e.g., 'Mean'), and setting parameters like window size or smoothing factor. # Connect an 'inject' node to its input to send numerical data (e.g., `msg.payload = 10`). # Connect a 'debug' node to its output to view the smoothed results. # Deploy the flow and observe the output in the debug sidebar.
Debug
Known issues
gotchaThis node strictly operates only on numbers. Any non-numeric input will be internally coerced to a number if possible, and if coercion fails, the message will be rejected. Always ensure `msg.payload` (or configured property) contains a valid number.
fix
Validate input messages before sending them to the smooth node, ensuring `msg.payload` is a number: `if (typeof msg.payload !== 'number') { return null; }`
affects: >=0.1.2
gotchaThe 'High Pass Smoothing' and 'Low Pass Smoothing' algorithms use a 'smoothing factor' which is inversely analogous to an alpha value (α). A higher smoothing factor means more smoothing, where a factor of 10 is similar to α=0.1. This can be counter-intuitive for users familiar with alpha (0 to 1) values in exponential smoothing.
fix
Refer to the node's help documentation in the Node-RED editor for detailed explanation of the smoothing factor's behavior and its relationship to traditional alpha values.
affects: >=0.1.2
gotchaSending a message with `msg.reset` (with any value) to the node will clear all internal counters and intermediate values, effectively restarting the smoothing process. This is useful for re-initializing state but can lead to unexpected output if triggered unintentionally.
fix
Only send `msg.reset` when you explicitly intend to reset the node's internal state. Design your flows to prevent accidental reset signals.
affects: >=0.1.2
Errors
Common errors & fixes
Input value is not a number and cannot be processed by the smooth node.
The node received a message where the payload (or configured property) was not a valid number, and could not be converted to one.
fix
Ensure that the `msg.payload` or the property configured for smoothing is always a number. Use a 'Change' or 'Function' node upstream to convert or filter non-numeric inputs.
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies
node-redrequiredThis package is a Node-RED node and requires the Node-RED runtime environment to function.
Agent activity
4 hits · last 30 days
node
4
Resources
node-red-node-smooth — npm install node-red-node-smooth · libregistry