Skip to content

Commit d935228

Browse files
author
Dave Conway-Jones
committed
update configuration docs
to close node-red#25
1 parent d403b81 commit d935228

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docs/configuration.md

+10-2
Original file line numberDiff line numberDiff 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

195203
debugMaxLength
196204
: Debug Nodes - the maximum length, in characters, of any message sent to the

0 commit comments

Comments
 (0)