From f70eb7caf35398fc2a6bcd1f90233e70126fa46b Mon Sep 17 00:00:00 2001 From: Ben Hardill Date: Fri, 22 Jul 2016 14:42:32 +0100 Subject: [PATCH 1/3] updates the configuration node to use the new context methods --- docs/configuration.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/configuration.md b/docs/configuration.md index 32fc228d..61ab7ffe 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -134,7 +134,15 @@ functionGlobalContext can be accessed in a function node as: - context.global.os + global.get('osModule') + +
Note: Prior to Node-RED v0.13, the documented +way to use global context was to access it as a sub-property of context: +
context.global.foo = "bar";
+var osModule = context.global.osModule;
+This method is still supported, but deprecated in favour of the global.get/global.set +functions. This is in anticipation of being able to persist the context data in a future release. +
debugMaxLength : Debug Nodes - the maximum length, in characters, of any message sent to the From 730a1c681a0d715b99df2dc6871cc7502837aec2 Mon Sep 17 00:00:00 2001 From: Ben Hardill Date: Fri, 22 Jul 2016 15:44:11 +0100 Subject: [PATCH 2/3] # This is a combination of 2 commits. # The first commit's message is: fixes multiple output from a function doc # This is the 2nd commit message: reverts the function doc change as it's just plain wrong --- docs/writing-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/writing-functions.md b/docs/writing-functions.md index 287118ad..c59cdcec 100644 --- a/docs/writing-functions.md +++ b/docs/writing-functions.md @@ -74,7 +74,7 @@ a message containing the payload length is passed to the second output: {% highlight javascript %} var newMsg = { payload: msg.payload.length }; -return [msg, newMsg]; +return [[msg], [newMsg]]; {% endhighlight %} #### Multiple Messages From bc94f1adfa111efa2dd917648c621f8c94ca226e Mon Sep 17 00:00:00 2001 From: Ben Hardill Date: Fri, 22 Jul 2016 16:03:59 +0100 Subject: [PATCH 3/3] fixes multiple output from a function doc reverts the function doc change as it's just plain wrong roll back --- docs/writing-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/writing-functions.md b/docs/writing-functions.md index c59cdcec..287118ad 100644 --- a/docs/writing-functions.md +++ b/docs/writing-functions.md @@ -74,7 +74,7 @@ a message containing the payload length is passed to the second output: {% highlight javascript %} var newMsg = { payload: msg.payload.length }; -return [[msg], [newMsg]]; +return [msg, newMsg]; {% endhighlight %} #### Multiple Messages