mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
add examples for function category nodes
This commit is contained in:
@@ -0,0 +1 @@
|
||||
[{"id":"e4d1d8.5684ee28","type":"inject","z":"f80cbd00.113d9","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":140,"wires":[["5f2fc1dc.04531"]]},{"id":"5f2fc1dc.04531","type":"exec","z":"f80cbd00.113d9","command":"/bin/ls","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":330,"y":140,"wires":[["a8226872.6072c8"],[],["2c84b8b0.f22a18"]]},{"id":"5f934490.218b5c","type":"comment","z":"f80cbd00.113d9","name":"Execute external command and get standard output","info":"Exec node can execute external command and can receive its standard output as a payload of first message. Standard error output can be received from second message. The exit code of the command can be obtained from `code` property of third message payload.\n\n*This example only works on UNIX flavored system.*","x":250,"y":40,"wires":[]},{"id":"2c84b8b0.f22a18","type":"debug","z":"f80cbd00.113d9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":510,"y":200,"wires":[]},{"id":"a8226872.6072c8","type":"debug","z":"f80cbd00.113d9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":510,"y":140,"wires":[]},{"id":"7e482077.285aa","type":"comment","z":"f80cbd00.113d9","name":"↓ execute /bin/ls command","info":"","x":390,"y":91,"wires":[]}]
|
@@ -0,0 +1 @@
|
||||
[{"id":"f507b27c.fff1","type":"inject","z":"462f83a6.d3c3cc","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":180,"wires":[["28b4f75a.eae548"]]},{"id":"28b4f75a.eae548","type":"exec","z":"462f83a6.d3c3cc","command":"/non/existing/command","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":350,"y":180,"wires":[[],["27992c1f.a1c964"],["6e7ff001.2412d"]]},{"id":"6e7ff001.2412d","type":"debug","z":"462f83a6.d3c3cc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":570,"y":240,"wires":[]},{"id":"27992c1f.a1c964","type":"debug","z":"462f83a6.d3c3cc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":570,"y":180,"wires":[]},{"id":"77e85c7c.a560d4","type":"comment","z":"462f83a6.d3c3cc","name":"Execute external command and get error output","info":"Exec node can execute external command and can receive its standard output as a payload of first message. Standard error output can be received from second message. The exit code of the command can be obtained from `code` property of third message payload.\n","x":220,"y":80,"wires":[]},{"id":"c188c28c.f7d34","type":"comment","z":"462f83a6.d3c3cc","name":"↓ try to execute non-existing command","info":"","x":390,"y":134,"wires":[]}]
|
@@ -0,0 +1 @@
|
||||
[{"id":"6a5f26a9.0cc2d8","type":"inject","z":"835cc8cc.b8cca8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"-l","payloadType":"str","x":170,"y":160,"wires":[["fc2b343c.bbe2f8"]]},{"id":"fc2b343c.bbe2f8","type":"exec","z":"835cc8cc.b8cca8","command":"/bin/ls","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":330,"y":160,"wires":[["2f3bcd73.6fedf2"],[],["3280586e.4e3d28"]]},{"id":"2f3bcd73.6fedf2","type":"debug","z":"835cc8cc.b8cca8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":510,"y":160,"wires":[]},{"id":"2b7bc9f1.ab36a6","type":"comment","z":"835cc8cc.b8cca8","name":"Execute external command appending additional args","info":"Exec node can execute external command and can receive its standard output as a payload of first message. Standard error output can be received from second message. The exit code of the command can be obtained from `code` property of third message payload.\n\nIf `Append msg.payload` checkbox is selected, payload value of the input message is appended to command string.\n\n*This example only works on UNIX flavored system.*","x":260,"y":60,"wires":[]},{"id":"3280586e.4e3d28","type":"debug","z":"835cc8cc.b8cca8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":510,"y":220,"wires":[]},{"id":"feba83da.8f227","type":"comment","z":"835cc8cc.b8cca8","name":"↓ execute /bin/ls command with -l option","info":"","x":440,"y":115,"wires":[]}]
|
@@ -0,0 +1 @@
|
||||
[{"id":"2e7be550.92ddfa","type":"inject","z":"a7f52169.f6c4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":160,"wires":[["53a714a8.1214dc"]]},{"id":"53a714a8.1214dc","type":"exec","z":"a7f52169.f6c4","command":"/bin/sh -c \"while true; do echo Hello; sleep 2; done\"","addpay":false,"append":"","useSpawn":"true","timer":"","oldrc":false,"name":"Repeat message output","x":410,"y":160,"wires":[["d1815f06.463f3"],["322d9b72.fc9194"],["2dbf8e03.2d6a52"]]},{"id":"7f351806.547908","type":"comment","z":"a7f52169.f6c4","name":"Execute external command in spawn mode","info":"Exec node can execute external command and can receive its standard output as a payload of first message. Standard error output can be received from second message. The exit code of the command can be obtained from `code` property of third message payload.\n\nIf `spawn mode` is selected, exec node returns the output as the command runs. \n\nSending `msg.kill` will kill a active process.\n\n*This example only works on UNIX flavored system.*","x":230,"y":60,"wires":[]},{"id":"2dbf8e03.2d6a52","type":"debug","z":"a7f52169.f6c4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":690,"y":200,"wires":[]},{"id":"d1815f06.463f3","type":"debug","z":"a7f52169.f6c4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":690,"y":120,"wires":[]},{"id":"28467ba9.c96284","type":"comment","z":"a7f52169.f6c4","name":"↓ spawn mode: repeat message output","info":"","x":450,"y":114,"wires":[]},{"id":"322d9b72.fc9194","type":"debug","z":"a7f52169.f6c4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":690,"y":160,"wires":[]},{"id":"d5a990ce.c660b","type":"inject","z":"a7f52169.f6c4","name":"Kill process","props":[{"p":"kill","v":"","vt":"date"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":220,"wires":[["53a714a8.1214dc"]]}]
|
Reference in New Issue
Block a user