ノードは、そのコンテキストオブジェクト内にデータを格納することができます。
コンテキストについての更なる情報は、コンテキストを利用するためのガイドを参照してください。
ノードに利用可能なコンテキストは3種類あります。
これらのコンテキストそれぞれにアクセスするための定義済み変数を持っているFunctionノードとは異なり、 カスタムノードは独自にこれらのコンテキストに アクセスする必要があります。
// Access the node's context object
var nodeContext = this.context();
var flowContext = this.context().flow;
var globalContext = this.context().global;
こららのコンテキストオブジェクトのそれぞれが同じようにget
/set
関数を有していることが
Functionノードを記述するためのガイドで説明されています。
注意: 他のノードによって使用されたり共有されたりする設定ノードは、ユーザーによる指定がない限り、デフォルトではグローバルです。 そのため、フローコンテキストへはアクセスできません。
Node-RED: Low-code programming for event-driven applications.
Copyright OpenJS Foundation and Node-RED contributors. All rights reserved. The OpenJS Foundation has registered trademarks and uses trademarks. For a list of trademarks of the OpenJS Foundation, please see our Trademark Policy and Trademark List. Trademarks and logos not indicated on the list of OpenJS Foundation trademarks are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
The OpenJS Foundation | Terms of Use | Privacy Policy | OpenJS Foundation Bylaws | Trademark Policy | Trademark List | Cookie Policy