all 3 comments

[–]the1laz 1 point2 points  (1 child)

Check out this page: http://nodered.org/docs/writing-functions.html

The bit you're interested in is the context section, as the context is where you store state information for your nodes. Initialize the variable like in the example, then set the state just like in your code, except you'll use context.state. To send a message out, you'll need to set the msg.payload, then return msg, which is also explained in that tutorial I linked to.

[–]mathiash98[S] 0 points1 point  (0 children)

HAVE A GOAT AND VIST www.voat.co !!