node-red-data-logger 0.1.0
Logs data stored in JSON object into a CSV file with columns extracted from JSON object.
node-red-contrib-csv-logger
A Node-RED Node that logs data stored in JSON object into a CSV file with columns extracted from JSON object.
This was first created by senselik, however I (Kepler7894i) needed to make some changes to the very useful npm package they provided (node-red-data-logger) - and have since decided to re-release it. Many thanks to the original creator.
Install
Run the following command in the root directory of your Node-RED install
npm install node-red-data-logger
Usage
- Data to be logged should be passed in
msg.payloadas 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.payloadwill be logged to file. msg.pathshould be passed in for setting the location where the file will be logged into.msg.fileNameshould be passed in to set the file name of the log file.msg.slashTypecan be passed to set whether files will be created in directories using forward("/") or back("") slashes, enabling override in case of OS misdetection - no entry will leave to default