File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -186,11 +186,19 @@ functionGlobalContext
186186: Function Nodes - a collection of objects to attach to the global function
187187 context. For example,
188188
189- functionGlobalContext: { os :require('os') }
189+ functionGlobalContext: { osModule :require('os') }
190190
191191 can be accessed in a function node as:
192192
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 >
194202
195203debugMaxLength
196204: 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