node-red/packages/node_modules/@node-red/nodes/examples/storage/write file/02 - Write string to a file...

118 lines
2.6 KiB
JSON

[
{
"id": "704479e1.399388",
"type": "inject",
"z": "6312c0588348b2d4",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "filename",
"v": "/tmp/hello.txt",
"vt": "str"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "Hello, World!",
"payloadType": "str",
"x": 190,
"y": 260,
"wires": [
[
"402f3b7e.988014"
]
]
},
{
"id": "8e876a75.e9beb8",
"type": "comment",
"z": "6312c0588348b2d4",
"name": "Write string to a file specied by filename property, the read from the file",
"info": "Write file node can target file using `filename` property.",
"x": 310,
"y": 180,
"wires": []
},
{
"id": "402f3b7e.988014",
"type": "file",
"z": "6312c0588348b2d4",
"name": "",
"filename": "",
"appendNewline": true,
"createDir": false,
"overwriteFile": "true",
"encoding": "none",
"x": 350,
"y": 260,
"wires": [
[
"26e077d6.bbcd98"
]
]
},
{
"id": "97b6b6b2.a54b38",
"type": "debug",
"z": "6312c0588348b2d4",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 730,
"y": 260,
"wires": []
},
{
"id": "26e077d6.bbcd98",
"type": "file in",
"z": "6312c0588348b2d4",
"name": "",
"filename": "/tmp/hello.txt",
"format": "utf8",
"chunk": false,
"sendError": false,
"encoding": "none",
"x": 540,
"y": 260,
"wires": [
[
"97b6b6b2.a54b38"
]
]
},
{
"id": "85062297.da79",
"type": "comment",
"z": "6312c0588348b2d4",
"name": "↑read result from file",
"info": "",
"x": 550,
"y": 300,
"wires": []
},
{
"id": "7316c4fc.b1dcdc",
"type": "comment",
"z": "6312c0588348b2d4",
"name": "↓write to file specified by filename property",
"info": "",
"x": 460,
"y": 220,
"wires": []
}
]