mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Storage examples (#2784)
* add examples of file node * add file-in node examples * add watch node examples
This commit is contained in:
committed by
GitHub
parent
575d07e41a
commit
7d08de9c99
108
packages/node_modules/@node-red/nodes/examples/storage/watch/01 - Watch change of a file.json
vendored
Normal file
108
packages/node_modules/@node-red/nodes/examples/storage/watch/01 - Watch change of a file.json
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
[
|
||||
{
|
||||
"id": "84222b92.d65d18",
|
||||
"type": "inject",
|
||||
"z": "a7ac8a68.0f7218",
|
||||
"name": "",
|
||||
"props": [
|
||||
{
|
||||
"p": "payload"
|
||||
},
|
||||
{
|
||||
"p": "topic",
|
||||
"vt": "str"
|
||||
}
|
||||
],
|
||||
"repeat": "",
|
||||
"crontab": "",
|
||||
"once": false,
|
||||
"onceDelay": 0.1,
|
||||
"topic": "",
|
||||
"payload": "Hello, World!",
|
||||
"payloadType": "str",
|
||||
"x": 230,
|
||||
"y": 160,
|
||||
"wires": [
|
||||
[
|
||||
"b4b9f603.739598"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "7b014430.dfd94c",
|
||||
"type": "comment",
|
||||
"z": "a7ac8a68.0f7218",
|
||||
"name": "Watch changes of a file",
|
||||
"info": "Watch node can watch and report changes of a file.",
|
||||
"x": 200,
|
||||
"y": 80,
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "b4b9f603.739598",
|
||||
"type": "file",
|
||||
"z": "a7ac8a68.0f7218",
|
||||
"name": "",
|
||||
"filename": "/tmp/hello.txt",
|
||||
"appendNewline": true,
|
||||
"createDir": false,
|
||||
"overwriteFile": "true",
|
||||
"encoding": "none",
|
||||
"x": 420,
|
||||
"y": 160,
|
||||
"wires": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "672d3693.3cabd8",
|
||||
"type": "comment",
|
||||
"z": "a7ac8a68.0f7218",
|
||||
"name": "↓write to /tmp/hello.txt",
|
||||
"info": "",
|
||||
"x": 440,
|
||||
"y": 120,
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "15f1f5aa.506ffa",
|
||||
"type": "watch",
|
||||
"z": "a7ac8a68.0f7218",
|
||||
"name": "",
|
||||
"files": "/tmp/hello.txt",
|
||||
"recursive": "",
|
||||
"x": 410,
|
||||
"y": 200,
|
||||
"wires": [
|
||||
[
|
||||
"a91562b9.ca805"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "a91562b9.ca805",
|
||||
"type": "debug",
|
||||
"z": "a7ac8a68.0f7218",
|
||||
"name": "",
|
||||
"active": true,
|
||||
"tosidebar": true,
|
||||
"console": false,
|
||||
"tostatus": false,
|
||||
"complete": "false",
|
||||
"statusVal": "",
|
||||
"statusType": "auto",
|
||||
"x": 610,
|
||||
"y": 200,
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "2ab4eba8.267d64",
|
||||
"type": "comment",
|
||||
"z": "a7ac8a68.0f7218",
|
||||
"name": "↑watch changes of /tmp/hello.txt",
|
||||
"info": "",
|
||||
"x": 470,
|
||||
"y": 240,
|
||||
"wires": []
|
||||
}
|
||||
]
|
163
packages/node_modules/@node-red/nodes/examples/storage/watch/02 - Watch change in a directory.json
vendored
Normal file
163
packages/node_modules/@node-red/nodes/examples/storage/watch/02 - Watch change in a directory.json
vendored
Normal file
@@ -0,0 +1,163 @@
|
||||
[
|
||||
{
|
||||
"id": "acec9dcc.eca82",
|
||||
"type": "inject",
|
||||
"z": "a7ac8a68.0f7218",
|
||||
"name": "",
|
||||
"props": [
|
||||
{
|
||||
"p": "payload"
|
||||
},
|
||||
{
|
||||
"p": "topic",
|
||||
"vt": "str"
|
||||
}
|
||||
],
|
||||
"repeat": "",
|
||||
"crontab": "",
|
||||
"once": false,
|
||||
"onceDelay": 0.1,
|
||||
"topic": "",
|
||||
"payload": "Hello, World!",
|
||||
"payloadType": "str",
|
||||
"x": 230,
|
||||
"y": 460,
|
||||
"wires": [
|
||||
[
|
||||
"137d60e2.0e267f"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cf011d1e.8afa6",
|
||||
"type": "comment",
|
||||
"z": "a7ac8a68.0f7218",
|
||||
"name": "Watch changes in a directory",
|
||||
"info": "Watch node can watch and report changes in a directory",
|
||||
"x": 220,
|
||||
"y": 340,
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "137d60e2.0e267f",
|
||||
"type": "file",
|
||||
"z": "a7ac8a68.0f7218",
|
||||
"name": "",
|
||||
"filename": "/tmp/HG/hello.txt",
|
||||
"appendNewline": true,
|
||||
"createDir": false,
|
||||
"overwriteFile": "true",
|
||||
"encoding": "none",
|
||||
"x": 430,
|
||||
"y": 460,
|
||||
"wires": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "9dfce283.63e5a",
|
||||
"type": "comment",
|
||||
"z": "a7ac8a68.0f7218",
|
||||
"name": "↓write to /tmp/HG/*",
|
||||
"info": "",
|
||||
"x": 430,
|
||||
"y": 420,
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "cbfb788b.297f98",
|
||||
"type": "watch",
|
||||
"z": "a7ac8a68.0f7218",
|
||||
"name": "",
|
||||
"files": "/tmp/HG",
|
||||
"recursive": false,
|
||||
"x": 400,
|
||||
"y": 540,
|
||||
"wires": [
|
||||
[
|
||||
"3c691cd5.a0f2b4"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "3c691cd5.a0f2b4",
|
||||
"type": "debug",
|
||||
"z": "a7ac8a68.0f7218",
|
||||
"name": "",
|
||||
"active": true,
|
||||
"tosidebar": true,
|
||||
"console": false,
|
||||
"tostatus": false,
|
||||
"complete": "false",
|
||||
"statusVal": "",
|
||||
"statusType": "auto",
|
||||
"x": 550,
|
||||
"y": 540,
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "c0d7ca6e.cad418",
|
||||
"type": "comment",
|
||||
"z": "a7ac8a68.0f7218",
|
||||
"name": "↑watch changes in /tmp/HG",
|
||||
"info": "",
|
||||
"x": 460,
|
||||
"y": 580,
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "a04e5231.5a2e1",
|
||||
"type": "inject",
|
||||
"z": "a7ac8a68.0f7218",
|
||||
"name": "",
|
||||
"props": [
|
||||
{
|
||||
"p": "payload"
|
||||
},
|
||||
{
|
||||
"p": "topic",
|
||||
"vt": "str"
|
||||
}
|
||||
],
|
||||
"repeat": "",
|
||||
"crontab": "",
|
||||
"once": false,
|
||||
"onceDelay": 0.1,
|
||||
"topic": "",
|
||||
"payload": "Goodbye, World!",
|
||||
"payloadType": "str",
|
||||
"x": 240,
|
||||
"y": 500,
|
||||
"wires": [
|
||||
[
|
||||
"655d7bab.cda6f4"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "655d7bab.cda6f4",
|
||||
"type": "file",
|
||||
"z": "a7ac8a68.0f7218",
|
||||
"name": "",
|
||||
"filename": "/tmp/HG/goodbye.txt",
|
||||
"appendNewline": true,
|
||||
"createDir": false,
|
||||
"overwriteFile": "true",
|
||||
"encoding": "none",
|
||||
"x": 440,
|
||||
"y": 500,
|
||||
"wires": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "f3b42209.a7673",
|
||||
"type": "comment",
|
||||
"z": "a7ac8a68.0f7218",
|
||||
"name": "Notice: Create /tmp/HG directory before deploying this example",
|
||||
"info": "",
|
||||
"x": 330,
|
||||
"y": 380,
|
||||
"wires": []
|
||||
}
|
||||
]
|
Reference in New Issue
Block a user