Skip to content

Instantly share code, notes, and snippets.

@pixelyunicorn pixelyunicorn/flow.json
Last active Apr 19, 2019

Embed
What would you like to do?
node-red flow for outputting npm log to text file and websocket
[{"id":"3e172437.a5953c","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"9ace9030.4080b","type":"catch","z":"3e172437.a5953c","name":"","scope":null,"uncaught":false,"x":180,"y":140,"wires":[["34b4e305.9edf6c"]]},{"id":"34b4e305.9edf6c","type":"debug","z":"3e172437.a5953c","name":"","active":true,"tosidebar":false,"console":true,"tostatus":false,"complete":"true","targetType":"full","x":410,"y":140,"wires":[]},{"id":"df0c7fd.f99f18","type":"exec","z":"3e172437.a5953c","command":"/code/test/install.sh","addpay":false,"append":"","useSpawn":"true","timer":"","oldrc":false,"name":"","x":300,"y":60,"wires":[["5887ee0f.44c9c"],[],["34b4e305.9edf6c"]]},{"id":"114ea54f.bcf11b","type":"inject","z":"3e172437.a5953c","name":"","topic":"","payload":"run","payloadType":"env","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":60,"wires":[["df0c7fd.f99f18"]]},{"id":"3b14cf3d.e5721","type":"debug","z":"3e172437.a5953c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1070,"y":180,"wires":[]},{"id":"74c59233.14da9c","type":"file","z":"3e172437.a5953c","name":"","filename":"/code/output.txt","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"none","x":1080,"y":140,"wires":[[]]},{"id":"5887ee0f.44c9c","type":"switch","z":"3e172437.a5953c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"Tree","vt":"str"},{"t":"cont","v":"http fetch","vt":"str"},{"t":"cont","v":"extract","vt":"str"},{"t":"cont","v":"build","vt":"str"},{"t":"cont","v":"install","vt":"str"},{"t":"cont","v":"decomposeActions","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":7,"x":550,"y":80,"wires":[["f51eabeb.7bc768"],["1f15d853.5ee8b8"],["f352ae2f.fe0c5"],["c43defd3.6e1d1"],["b9eabb1d.51d808"],["fae75082.0ddbb"],["b2335da0.1a22f"]]},{"id":"f51eabeb.7bc768","type":"function","z":"3e172437.a5953c","name":"Tree","func":"msg.payload = {\n event: 'tree',\n message: msg.payload\n};\nreturn msg;","outputs":1,"noerr":0,"x":750,"y":20,"wires":[["63b7254b.1086cc"]]},{"id":"63b7254b.1086cc","type":"websocket out","z":"3e172437.a5953c","name":"","server":"3bc68332.5e173c","client":"","x":1060,"y":100,"wires":[]},{"id":"1f15d853.5ee8b8","type":"function","z":"3e172437.a5953c","name":"http fetch","func":"msg.payload = {\n event: 'http fetch',\n message: msg.payload\n};\nreturn msg;","outputs":1,"noerr":0,"x":760,"y":60,"wires":[["63b7254b.1086cc"]]},{"id":"f352ae2f.fe0c5","type":"function","z":"3e172437.a5953c","name":"extract","func":"msg.payload = {\n event: 'extract',\n message: msg.payload\n};\nreturn msg;","outputs":1,"noerr":0,"x":760,"y":100,"wires":[["63b7254b.1086cc"]]},{"id":"c43defd3.6e1d1","type":"function","z":"3e172437.a5953c","name":"build","func":"msg.payload = {\n event: 'build',\n message: msg.payload\n};\nreturn msg;","outputs":1,"noerr":0,"x":750,"y":140,"wires":[["63b7254b.1086cc"]]},{"id":"b9eabb1d.51d808","type":"function","z":"3e172437.a5953c","name":"install","func":"msg.payload = {\n event: 'install',\n message: msg.payload\n};\nreturn msg;","outputs":1,"noerr":0,"x":750,"y":180,"wires":[["63b7254b.1086cc"]]},{"id":"b2335da0.1a22f","type":"function","z":"3e172437.a5953c","name":"other","func":"msg.payload = {\n event: 'other',\n message: msg.payload\n};\nreturn msg;","outputs":1,"noerr":0,"x":750,"y":260,"wires":[["63b7254b.1086cc"]]},{"id":"fae75082.0ddbb","type":"function","z":"3e172437.a5953c","name":"decompose","func":"msg.payload = {\n event: 'decompose',\n message: msg.payload\n};\nreturn msg;","outputs":1,"noerr":0,"x":770,"y":220,"wires":[["63b7254b.1086cc"]]},{"id":"3bc68332.5e173c","type":"websocket-listener","z":"","path":"/ws","wholemsg":"false"}]
npm install 2>&1 --cache /code/npm_cache/ --ddd react-native
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.