Socket
Socket
Sign inDemoInstall

node-red-contrib-data-logger

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    node-red-contrib-data-logger

Logs data stored in JSON object into a CSV file with columns extracted from JSON object.


Version published
Weekly downloads
16
decreased by-5.88%
Maintainers
1
Install size
25.9 kB
Created
Weekly downloads
 

Readme

Source

node-red-contrib-data-logger

A Node-RED Node that logs data stored in JSON object into a CSV file with columns extracted from JSON object..

Install

Run the following command in the root directory of your Node-RED install

npm install node-red-contrib-data-logger

Usage

  • Data to be logged should be passed in msg.payload as a JSON object. The header row will be populated with the property names of the JSON object on log file creation.
  • The Columns property in node properties can be used as a filter if filled with JSON object's property names as comma separated string. If left empty, all properties of JSON object in msg.payload will be logged to file.
  • msg.path should be passed in for setting the location where the file will be logged into.
  • msg.fileName should be passed in to set the file name of the log file.

Example Flow

[{"id":"88258a55.901628","type":"inject","z":"3c62c132.455f6e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":440,"y":480,"wires":[["54f959e1.e9fc88"]]},{"id":"54f959e1.e9fc88","type":"function","z":"3c62c132.455f6e","name":"Log Data","func":"var logPath = ".";\nvar folderName = "DataLog\\TestData";\nmsg.path = logPath + "\\" + folderName;\nmsg.fileName = "testFile";\n\nvar data = {};\n\nfor (var i = 0; i < 10; i++){\n data["Data"+i] = i*10;\n}\n\nmsg.payload = data;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":660,"y":480,"wires":[["dbb8420e.ee474"]]},{"id":"dbb8420e.ee474","type":"data-logger","z":"3c62c132.455f6e","name":"","columns":"","parentDir":"","enableBuffering":"0","bufferSize":10,"bufferTimeout":1,"enableDateColumn":"1","seperator":",","x":880,"y":480,"wires":[]}]

Keywords

FAQs

Last updated on 12 Jul 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc