File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -186,11 +186,19 @@ functionGlobalContext
186
186
: Function Nodes - a collection of objects to attach to the global function
187
187
context. For example,
188
188
189
- functionGlobalContext: { os :require('os') }
189
+ functionGlobalContext: { osModule :require('os') }
190
190
191
191
can be accessed in a function node as:
192
192
193
- context.global.os
193
+ var myos = global.get('osModule');
194
+
195
+ <div class =" doc-callout " ><em >Note</em >: Prior to Node-RED v0.13, the documented
196
+ way to use global context was to access it as a sub-property of <code >context</code >:
197
+ <pre >context.global.foo = "bar";
198
+ var osModule = context.global.osModule;</pre >
199
+ This method is still supported, but deprecated in favour of the <code >global.get</code >/<code >global.set</code >
200
+ functions. This is in anticipation of being able to persist the context data in a future release.
201
+ </div >
194
202
195
203
debugMaxLength
196
204
: Debug Nodes - the maximum length, in characters, of any message sent to the
You can’t perform that action at this time.
0 commit comments