@optyne/node-red-contrib-2j4y7k4 1.0.3
A simple Node-RED node with an example
@optyne/node-red-contrib-2j4y7k4 A simple Node-RED node that converts input text to uppercase, with an included example flow.
Overview This package provides a custom Node-RED node called my-example. The node takes an input message, converts the msg.payload to uppercase, and passes it along the flow. It also includes an example flow to demonstrate its usage.
Installation Prerequisites Node-RED must be installed and running on your system. Node.js and npm should be installed. Install via Node-RED Palette Open your Node-RED editor (e.g., http://localhost:1880). Go to the menu (top-right) and select Manage Palette. In the Install tab, search for @optyne/node-red-contrib-2j4y7k4. Click Install and wait for the process to complete. Restart Node-RED if prompted. Install via Command Line Navigate to your Node-RED user directory (default is ~/.node-red on Unix-like systems or %userprofile%.node-red on Windows). bash
收起
換行
複製 cd ~/.node-red Run the following command: bash
收起
換行
複製 npm install @optyne/node-red-contrib-2j4y7k4 Restart Node-RED: bash
收起
換行
複製 node-red-stop node-red-start Usage After installation, the my-example node will appear in the function category of the Node-RED palette. Drag the my-example node into your flow. Connect it to an input node (e.g., inject) and an output node (e.g., debug). Deploy your flow. Send a message through the node, and it will convert the msg.payload to uppercase. Node Properties Name: (Optional) Set a custom name for the node in the editor. Input msg.payload: The input value to be converted to uppercase (must be a string or convertible to a string). Output msg.payload: The uppercase version of the input string. Example Flow This package includes an example flow that demonstrates how to use the my-example node. To import it:
In the Node-RED editor, go to the menu (top-right) and select Import > Examples. Find @optyne/node-red-contrib-2j4y7k4 in the list and select the example flow. Import and deploy the flow. The example flow includes:
An inject node sending the string "hello". The my-example node converting it to "HELLO". A debug node displaying the result. Here is the JSON for the example flow:
json
收起
換行
複製 [ { "id": "node1", "type": "inject", "name": "Inject", "props": [{ "p": "payload" }], "payload": "hello", "payloadType": "str", "x": 100, "y": 100, "wires": [["node2"]] }, { "id": "node2", "type": "my-example", "name": "My Example", "x": 300, "y": 100, "wires": [["node3"]] }, { "id": "node3", "type": "debug", "name": "Debug", "active": true, "x": 500, "y": 100, "wires": [] } ] Development To modify or contribute to this node:
Clone the repository or download the package source. Install dependencies: bash
收起
換行
複製 npm install Link it to your Node-RED instance for testing: bash
收起
換行
複製 npm link cd ~/.node-red npm link @optyne/node-red-contrib-2j4y7k4 Restart Node-RED and test your changes. License This project is licensed under the MIT License. See the LICENSE file for details.
Author Your Name (replace with your actual name or handle) Issues If you encounter any problems or have suggestions, please file an issue on the project's GitHub repository (if available) or contact the author.