node-red-contrib-manage-flow-by-git
Feature
- for Node-RED.
- Manage flow by git.
- It is easy to watch diff of
function node
andtemplate node
. - Export XML. Flow(XML) optimized for git diff.
- Sort node by id.
- JSON for restoration is also included in XML.
- Be careful with handling due to it is informal processing.
- Committing this XML to git makes it easy to manage.
Released
Date | Version | Description |
---|---|---|
2017-09-26 | 0.0.16 | a little modification |
2017-09-24 | 0.0.7 | Update README. |
2017-09-23 | 0.0.1 | Released |
Install
npm install --save node-red-contrib-manage-flow-by-git
Usage
- Open "by git" tab.
- Select nodes.
- Get XML.
- Download XML.
Warning
<json></json>
contains JSON that can be imported with Node-RED.- However, It can not be guaranteed.
- Please check it yourself.
Example XML
584eb128.a27c8 function get time <![CDATA[var datetime = new Date(msg.payload);var to2digits = function(value) { return ("0" + value).slice(-2);}var time = [];time.push(to2digits(datetime.getHours()));time.push(to2digits(datetime.getMinutes()));time.push(to2digits(datetime.getSeconds()));msg.time = time.join(":");return msg;]]> 0 9a8e7d63.37d2e 9a8e7d63.37d2e template toJson payload msg handlebars mustache <![CDATA[{ "timestamp": "{{{payload}}}", "time": "{{{time}}}"}]]> json eda3572b.b93a28 e33d76a.36b0288 inject repeat 1m foo date 60 false 584eb128.a27c8 eda3572b.b93a28 debug debug false payload <![CDATA[[{"id":"584eb128.a27c8","type":"function","name":"get time","func":"var datetime = new Date(msg.payload);\nvar to2digits = function(value) {\n return (\"0\" + value).slice(-2);\n}\nvar time = [];\ntime.push(to2digits(datetime.getHours()));\ntime.push(to2digits(datetime.getMinutes()));\ntime.push(to2digits(datetime.getSeconds()));\nmsg.time = time.join(\":\");\nreturn msg;","outputs":1,"noerr":"0","x":160,"y":140,"wires":[["9a8e7d63.37d2e"]]},{"id":"9a8e7d63.37d2e","type":"template","name":"toJson","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n \"timestamp\": \"{{{payload}}}\",\n \"time\": \"{{{time}}}\"\n}","output":"json","x":190,"y":200,"wires":[["eda3572b.b93a28"]]},{"id":"e33d76a.36b0288","type":"inject","name":"repeat 1m","topic":"foo","payload":"","payloadType":"date","repeat":"60","crontab":"","once":"false","x":130,"y":80,"wires":[["584eb128.a27c8"]]},{"id":"eda3572b.b93a28","type":"debug","name":"debug","active":true,"console":"false","complete":"payload","x":230,"y":260,"wires":[[]]}]]]>
Compare json with xml.
Screenshots
- Tab
- Node (do nothing)