Correct emoncms package.json (remove extra ,)

Update sample nodes in line with main nodes directory
This commit is contained in:
dceejay 2015-01-04 21:14:00 +00:00
parent f6dc63953c
commit c7c8a9bbe2
3 changed files with 13 additions and 10 deletions

View File

@ -17,7 +17,7 @@
<!-- Sample html file that corresponds to the 99-sample.js file --> <!-- Sample html file that corresponds to the 99-sample.js file -->
<!-- This creates and configures the onscreen elements of the node --> <!-- This creates and configures the onscreen elements of the node -->
<!-- If you use this as a template, replace IBM Corp. with your own name. --> <!-- If you use this as a template, update the copyright with your own name. -->
<!-- First, the content of the edit dialog is defined. --> <!-- First, the content of the edit dialog is defined. -->

View File

@ -14,11 +14,11 @@
* limitations under the License. * limitations under the License.
**/ **/
// If you use this as a template, replace IBM Corp. with your own name. // If you use this as a template, update the copyright with your own name.
// Sample Node-RED node file // Sample Node-RED node file
// Require main module
module.exports = function(RED) { module.exports = function(RED) {
"use strict"; "use strict";
// require any external libraries we may need.... // require any external libraries we may need....
@ -31,6 +31,7 @@ module.exports = function(RED) {
// Store local copies of the node configuration (as defined in the .html) // Store local copies of the node configuration (as defined in the .html)
this.topic = n.topic; this.topic = n.topic;
var node = this;
// Do whatever you need to do in here - declare callbacks etc // Do whatever you need to do in here - declare callbacks etc
// Note: this sample doesn't do anything much - it will only send // Note: this sample doesn't do anything much - it will only send
@ -41,23 +42,25 @@ module.exports = function(RED) {
msg.payload = "Hello world !" msg.payload = "Hello world !"
// send out the message to the rest of the workspace. // send out the message to the rest of the workspace.
this.send(msg); // ... this message will get sent at startup so you may not see it in a debug node.
node.send(msg);
// respond to inputs.... // respond to inputs....
this.on('input', function (msg) { node.on('input', function (msg) {
node.warn("I saw a payload: "+msg.payload); node.warn("I saw a payload: "+msg.payload);
// in this example just send it straight on... should process it here really // in this example just send it straight on... should process it here really
this.send(msg); node.send(msg);
} });
this.on("close", function() { node.on("close", function() {
// Called when the node is shutdown - eg on redeploy. // Called when the node is shutdown - eg on redeploy.
// Allows ports to be closed, connections dropped etc. // Allows ports to be closed, connections dropped etc.
// eg: this.client.disconnect(); // eg: node.client.disconnect();
}); });
} }
// Register the node by name. This must be called before overriding any of the // Register the node by name. This must be called before overriding any of the
// Node functions. // Node functions.
RED.nodes.registerType("sample",SampleNode); RED.nodes.registerType("sample",SampleNode);
} }

View File

@ -25,5 +25,5 @@
"name": "dceejay", "name": "dceejay",
"email": "ceejay@vnet.ibm.com" "email": "ceejay@vnet.ibm.com"
} }
], ]
} }