1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Allow File out node to handle objects more usefully.

This commit is contained in:
Dave C-J 2014-04-14 15:49:49 +01:00
parent be5f6762f7
commit 7290512794

View File

@ -29,8 +29,10 @@ function FileNode(n) {
if (filename == "") { if (filename == "") {
node.warn('No filename specified'); node.warn('No filename specified');
} else { } else if (typeof msg.payload != "undefined") {
var data = msg.payload; var data = msg.payload;
if (typeof data == "object") { data = JSON.stringify(data); }
if (typeof data == "boolean") { data = data.toString(); }
if (this.appendNewline) { if (this.appendNewline) {
data += "\n"; data += "\n";
} }