Allow File out node to handle objects more usefully.

pull/198/head
Dave C-J 2014-04-14 15:49:49 +01:00
parent be5f6762f7
commit 7290512794
1 changed files with 3 additions and 1 deletions

View File

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