a node-red node contains 3 files. 1. package.json 2. html spec for node 3. nodejs file.…
- User
a node-red node contains 3 files. 1. package.json 2. html spec for node 3. nodejs file. Generate a node-red node called Pankaj
Assistant
Here is sample code for a node-red node called "Pankaj":
package.json:
{ "name": "node-red-contrib-pankaj", "version": "0.1.0", "description": "Pankaj node", "main": "pankaj.js", "node-red": { "nodes": { "pankaj": "pankaj.js" } } }pankaj.html:
<script type="text/html" data-template-name="pankaj"> <div class="form-row"> <label for="node-input-name"><i class="icon-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> </script>pankaj.js:
module.exports = function(RED) { function PankajNode(config) { RED.nodes.createNode(this,config); var node = this; node.on('input', function(msg) { msg.payload = "Hello from Pankaj node!"; node.send(msg); }); } RED.nodes.registerType("pankaj", PankajNode); }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.