node-red-contrib-taha-demo 1.0.0
A simple Node-RED node for the IoT TP
node-red-contrib-taha-demo
A minimal custom Node-RED node created for an IoT practical (TP) at ISIMM. It demonstrates the full lifecycle of a node: development, local testing with npm link, packaging, and publishing.
Educational node. It has no practical use and is not intended for production flows.
Overview
The node receives a message and replaces msg.payload with the constant string "Taha", whatever the input was (string, number, object, etc.). The message is then forwarded to the next node in the flow.
| Node type | tahademo |
| Category | function |
| Inputs | 1 |
| Outputs | 1 |
Prerequisites
Installation
From the Node-RED editor
- Open the menu (top right) and choose Manage palette.
- Go to the Install tab.
- Search for
node-red-contrib-taha-demoand click install.
From the command line
Run this in your Node-RED user directory (usually ~/.node-red, or C:\Users\<you>\.node-red on Windows):
npm install node-red-contrib-taha-demo
Restart Node-RED afterwards.
Local development (npm link)
# inside the node's folder
npm link
# inside your Node-RED user directory
npm link node-red-contrib-taha-demo
Restart Node-RED. Do not run npm install in the user directory afterwards, as it removes the link.
Usage
- Drag the tahademo node from the function category onto the canvas.
- Wire it between a source node (for example inject) and a debug node.
- Deploy the flow and click the button on the inject node.
- The debug panel shows
"Taha".
Input msg.payload |
Output msg.payload |
|---|---|
"MY NAME IS TAHA" |
"Taha" |
42 |
"Taha" |
{ "a": 1 } |
"Taha" |
Example flow
Import this flow with Menu → Import → Clipboard:
[
{
"id": "inject1",
"type": "inject",
"z": "flow1",
"name": "",
"props": [{ "p": "payload" }],
"payload": "Hello Node-RED!",
"payloadType": "str",
"x": 150,
"y": 100,
"wires": [["taha1"]]
},
{
"id": "taha1",
"type": "tahademo",
"z": "flow1",
"name": "",
"x": 340,
"y": 100,
"wires": [["debug1"]]
},
{
"id": "debug1",
"type": "debug",
"z": "flow1",
"name": "",
"active": true,
"tosidebar": true,
"complete": "payload",
"targetType": "msg",
"x": 530,
"y": 100,
"wires": []
}
]
Screenshots
Project structure
node-red-contrib-taha-demo/
├── node.js # runtime logic (what the node does)
├── node.html # editor UI: appearance, edit dialog, help text
├── package.json # npm metadata and the "node-red" registration block
├── README.md
└── LICENSE
Change log
| Version | Changes |
|---|---|
| 1.0.0 | Initial release: node outputs the constant string "Taha". |
License
Author
Taha, Software Engineering student at ISIMM, Monastir, Tunisia.