diff --git a/packages/node_modules/@node-red/nodes/locales/en-US/function/10-function.html b/packages/node_modules/@node-red/nodes/locales/en-US/function/10-function.html index 93a1d6f51f..891801bf9c 100644 --- a/packages/node_modules/@node-red/nodes/locales/en-US/function/10-function.html +++ b/packages/node_modules/@node-red/nodes/locales/en-US/function/10-function.html @@ -23,6 +23,7 @@ to return nothing in order to halt a flow.

The Setup tab contains code that will be run whenever the node is started. The Close tab contains code that will be run when the node is stopped.

+

If an promise object is returned from the setup code, input message processing starts after its completion.

Details

See the online documentation for more information on writing functions.

@@ -34,6 +35,7 @@

Sending messages

  • a single message object - passed to nodes connected to the first output
  • an array of message objects - passed to nodes connected to the corresponding outputs
  • +

    Note: The setup code is executed during the initialization of nodes. Therefore, if node.send is called in the setup tab, subsequent nodes may not be able to receive the message.

    If any element of the array is itself an array of messages, multiple messages are sent to the corresponding output.

    If null is returned, either by itself or as an element of the array, no diff --git a/packages/node_modules/@node-red/nodes/locales/ja/function/10-function.html b/packages/node_modules/@node-red/nodes/locales/ja/function/10-function.html index b348512dfd..de6f44e3d9 100644 --- a/packages/node_modules/@node-red/nodes/locales/ja/function/10-function.html +++ b/packages/node_modules/@node-red/nodes/locales/ja/function/10-function.html @@ -20,6 +20,7 @@

    msgオブジェクトはmsg.payloadプロパティにメッセージ本体を保持するのが慣例です。

    通常、コードはメッセージオブジェクト(もしくは複数のメッセージオブジェクト)を返却します。後続フローの実行を停止したい場合は、オブジェクトを返却しなくてもかまいません。

    Node-REDの開始時もしくはフローの設定をデプロイした際実行される初期化コードを初期化処理タブに、ノードの停止もしくは再デプロイ時に実行される終了処理コードを終了処理タブに指定できます。

    +

    初期化処理タブの返却値としてPromiseを返却すると、入力メッセージの処理を開始する前にその完了を待ちます。

    詳細

    コードの書き方の詳細については、オンラインドキュメントを参照してください。

    メッセージの送信

    @@ -29,6 +30,7 @@

    メッセージの送信

  • 単一メッセージオブジェクト - 最初の出力に接続されたノードに渡されます
  • メッセージオブジェクトの配列 - 対応する出力に接続されたノードに渡されます
  • +

    注: 初期化処理の実行はノードの初期化中に行われます。そのため、初期化処理タブにsendを記述した場合に後続ノードでメッセージを受け取れないことがあります。

    配列要素が配列の場合には、複数のメッセージを対応する出力に送出します。

    返却方法が単一値か配列要素かにかかわらず、返却値がnullの場合メッセージの送出は行いません。

    ログ出力とエラー処理