Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion nodes/v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = function (RED) {
var json = null;

temp.open({
suffix: '.txt'
suffix: '.json'
}, function(err, info) {
if (err) {
node.status({
Expand All @@ -48,6 +48,7 @@ module.exports = function (RED) {
// gets read in as json data, so no buffering or conversion
// is required.
if (msg.payload instanceof Buffer) {
//console.log('Its a Buffer');
fs.writeFile(info.path, msg.payload, function(err) {
if (err) {
node.status({
Expand All @@ -73,6 +74,8 @@ module.exports = function (RED) {
// is where it gets processed. Yes, it suprised me also, all the
// buffering is only required if the file extension is not .json,
// but still contains json data.
//console.log('Its not a buffer');
//console.log(typeof msg.payload);
json = msg.payload;
cb(null, json);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-json2csv",
"version": "0.0.1",
"version": "0.0.2",
"description": "A node to convert json to csv",
"dependencies": {
"jsonexport": "~1.5.2",
Expand Down