{"_id":"@digitalnodecom/node-red-contrib-papaparse","_rev":"4-87d58eb18e797b4f7b83432cbc88f69b","name":"@digitalnodecom/node-red-contrib-papaparse","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@digitalnodecom/node-red-contrib-papaparse","version":"1.0.0","keywords":["node-red","csv","parser","papaparse","json"],"author":"","license":"ISC","_id":"@digitalnodecom/node-red-contrib-papaparse@1.0.0","maintainers":[{"name":"trajcheee","email":"trajche@kralev.eu"},{"name":"riste","email":"riste@digitalnode.com"},{"name":"bojanataseva","email":"bojana@digitalnode.com"}],"homepage":"https://github.com/digitalnodecom/node-red-contrib-papaparse#readme","bugs":{"url":"https://github.com/digitalnodecom/node-red-contrib-papaparse/issues"},"dist":{"shasum":"bfd0c17f1adaad40de1c23080e463e14a09e8347","tarball":"https://registry.npmjs.org/@digitalnodecom/node-red-contrib-papaparse/-/node-red-contrib-papaparse-1.0.0.tgz","fileCount":7,"integrity":"sha512-asmTI5XNveJhNUdmqNHxLn+VEC3azTydL1DoVIQYCXlCOJuFOy9ThxT5Izg38//WXlJp6ynzejT3goF17nJhag==","signatures":[{"sig":"MEYCIQDD5vs/FAcV5tVBYWafG4BBN8VGhz+MX5oNZQx2dqG20QIhANYUKDyho01UNTE1YiwxC1RvGg/MZuhIoZeEfxOKnZed","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27392},"main":"papaparse.js","engines":{"node":">=12.0.0"},"gitHead":"90f76693db2ca34f8ba310461125ecbba3ecadd2","scripts":{"test":"mocha \"test/**/*_spec.js\""},"_npmUser":{"name":"trajcheee","email":"trajche@kralev.eu"},"node-red":{"nodes":{"papaparse":"papaparse.js","papaunparse":"papaunparse.js"}},"repository":{"url":"git+https://github.com/digitalnodecom/node-red-contrib-papaparse.git","type":"git"},"_npmVersion":"10.5.0","description":"A Node-RED node that uses PapaParse for CSV parsing and unparsing with enhanced features and performance","directories":{},"_nodeVersion":"21.7.3","dependencies":{"node-red":"^4.0.9","papaparse":"^5.5.2"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^11.1.0","node-red-node-test-helper":"^0.3.4"},"_npmOperationalInternal":{"tmp":"tmp/node-red-contrib-papaparse_1.0.0_1742153045111_0.052741805233481376","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-03-16T19:24:05.010Z","modified":"2026-01-13T22:17:43.219Z","1.0.0":"2025-03-16T19:24:05.305Z"},"bugs":{"url":"https://github.com/digitalnodecom/node-red-contrib-papaparse/issues"},"license":"ISC","homepage":"https://github.com/digitalnodecom/node-red-contrib-papaparse#readme","keywords":["node-red","csv","parser","papaparse","json"],"repository":{"url":"git+https://github.com/digitalnodecom/node-red-contrib-papaparse.git","type":"git"},"description":"A Node-RED node that uses PapaParse for CSV parsing and unparsing with enhanced features and performance","maintainers":[{"email":"trajche@kralev.eu","name":"trajcheee"},{"email":"simon@digitalnode.com","name":"simonanastasov"}],"readme":"# node-red-contrib-papaparse\n\nA Node-RED node that uses [PapaParse](https://www.papaparse.com/) for CSV parsing and unparsing with enhanced features and performance compared to the built-in CSV parser in Node-RED.\n\n## Installation\n\nYou can install this node directly from the Node-RED palette manager, or run the following command in your Node-RED user directory (typically `~/.node-red`):\n\n```bash\nnpm install node-red-contrib-papaparse\n```\n\n## Features\n\n- **Better Performance**: PapaParse is optimized for speed and can handle large CSV files efficiently.\n- **More Options**: Provides more configuration options than the built-in CSV parser.\n- **Dynamic Typing**: Automatically converts numeric and boolean values to their respective types.\n- **Header Row Support**: Can use the first row as field names.\n- **Error Handling**: Provides detailed error information when parsing fails.\n- **Metadata**: Includes metadata about the parsing process in the output.\n- **Bidirectional Conversion**: Includes nodes for both CSV-to-JSON parsing and JSON-to-CSV unparsing.\n- **Smart Input Handling**: The unparsing node can automatically detect and parse JSON strings, making it easy to use with file nodes.\n\n## Nodes\n\nThis package provides two nodes:\n\n### 1. papaparse (CSV to JSON)\n\nConverts CSV data to JSON format.\n\n#### Usage\n\n1. Add the PapaParse node to your flow.\n2. Configure the node according to your CSV format.\n3. Send a message with the CSV data in the `msg.payload` property.\n4. The node will output a message with the parsed data in the `msg.payload` property and metadata in the `msg.meta` property.\n\n#### Configuration Options\n\n- **Header Row**: If checked, the first row of the CSV will be treated as field names.\n- **Skip Empty Lines**: If checked, empty lines will be skipped.\n- **Dynamic Typing**: If checked, numeric and boolean values will be converted to their respective types.\n- **Delimiter**: The character used to separate values. Leave empty for auto-detection.\n- **Newline**: The character used for line breaks. Leave empty for auto-detection.\n- **Quote Char**: The character used to quote fields.\n- **Escape Char**: The character used to escape special characters.\n- **Comments**: If checked, lines starting with the comment character will be skipped.\n- **Fast Mode**: If checked, certain optimizations will be enabled at the expense of some features.\n\n### 2. papaunparse (JSON to CSV)\n\nConverts JSON data to CSV format.\n\n#### Usage\n\n1. Add the PapaUnparse node to your flow.\n2. Configure the node according to your desired CSV format.\n3. Send a message with the JSON data in the `msg.payload` property. This can be:\n   - An array of objects or an array of arrays\n   - A JSON string containing an array (will be automatically parsed)\n4. The node will output a message with the CSV string in the `msg.payload` property.\n\n#### Configuration Options\n\n- **Include Headers**: If checked, field names will be included as the first row of the CSV.\n- **Skip Empty Lines**: If checked, empty lines will be skipped.\n- **Delimiter**: The character used to separate values. Leave empty for default (,).\n- **Newline**: The character used for line breaks. Leave empty for default (\\n).\n- **Quote Char**: The character used to quote fields.\n- **Escape Char**: The character used to escape special characters.\n- **Columns**: Optional comma-separated list of columns to include in the output. If not specified, all columns will be included.\n\n## Example Flows\n\n### CSV to JSON Example\n\n```json\n[\n    {\n        \"id\": \"f6f2187d.f17ca8\",\n        \"type\": \"inject\",\n        \"z\": \"2b9467c1.b7c8c8\",\n        \"name\": \"Sample CSV\",\n        \"props\": [\n            {\n                \"p\": \"payload\"\n            }\n        ],\n        \"repeat\": \"\",\n        \"crontab\": \"\",\n        \"once\": false,\n        \"onceDelay\": 0.1,\n        \"topic\": \"\",\n        \"payload\": \"name,age,city\\nJohn,30,New York\\nJane,25,San Francisco\\nBob,40,Chicago\",\n        \"payloadType\": \"str\",\n        \"x\": 140,\n        \"y\": 120,\n        \"wires\": [\n            [\n                \"a7f4d89d.cb4b58\"\n            ]\n        ]\n    },\n    {\n        \"id\": \"a7f4d89d.cb4b58\",\n        \"type\": \"papaparse\",\n        \"z\": \"2b9467c1.b7c8c8\",\n        \"name\": \"\",\n        \"header\": true,\n        \"skipEmptyLines\": true,\n        \"dynamicTyping\": true,\n        \"delimiter\": \"\",\n        \"newline\": \"\",\n        \"quoteChar\": \"\\\"\",\n        \"escapeChar\": \"\\\"\",\n        \"comments\": false,\n        \"fastMode\": false,\n        \"x\": 320,\n        \"y\": 120,\n        \"wires\": [\n            [\n                \"8f347a9a.41c7b8\"\n            ]\n        ]\n    },\n    {\n        \"id\": \"8f347a9a.41c7b8\",\n        \"type\": \"debug\",\n        \"z\": \"2b9467c1.b7c8c8\",\n        \"name\": \"Parsed CSV\",\n        \"active\": true,\n        \"tosidebar\": true,\n        \"console\": false,\n        \"tostatus\": false,\n        \"complete\": \"true\",\n        \"targetType\": \"full\",\n        \"statusVal\": \"\",\n        \"statusType\": \"auto\",\n        \"x\": 500,\n        \"y\": 120,\n        \"wires\": []\n    }\n]\n```\n\n### JSON to CSV Example\n\n```json\n[\n    {\n        \"id\": \"e5f2187d.f17ca8\",\n        \"type\": \"inject\",\n        \"z\": \"2b9467c1.b7c8c8\",\n        \"name\": \"Sample JSON\",\n        \"props\": [\n            {\n                \"p\": \"payload\"\n            }\n        ],\n        \"repeat\": \"\",\n        \"crontab\": \"\",\n        \"once\": false,\n        \"onceDelay\": 0.1,\n        \"topic\": \"\",\n        \"payload\": \"[{\\\"name\\\":\\\"John\\\",\\\"age\\\":30,\\\"city\\\":\\\"New York\\\"},{\\\"name\\\":\\\"Jane\\\",\\\"age\\\":25,\\\"city\\\":\\\"San Francisco\\\"},{\\\"name\\\":\\\"Bob\\\",\\\"age\\\":40,\\\"city\\\":\\\"Chicago\\\"}]\",\n        \"payloadType\": \"json\",\n        \"x\": 140,\n        \"y\": 220,\n        \"wires\": [\n            [\n                \"b7f4d89d.cb4b58\"\n            ]\n        ]\n    },\n    {\n        \"id\": \"b7f4d89d.cb4b58\",\n        \"type\": \"papaunparse\",\n        \"z\": \"2b9467c1.b7c8c8\",\n        \"name\": \"\",\n        \"header\": true,\n        \"skipEmptyLines\": true,\n        \"delimiter\": \"\",\n        \"newline\": \"\",\n        \"quoteChar\": \"\\\"\",\n        \"escapeChar\": \"\\\"\",\n        \"columns\": \"\",\n        \"x\": 330,\n        \"y\": 220,\n        \"wires\": [\n            [\n                \"9f347a9a.41c7b8\"\n            ]\n        ]\n    },\n    {\n        \"id\": \"9f347a9a.41c7b8\",\n        \"type\": \"debug\",\n        \"z\": \"2b9467c1.b7c8c8\",\n        \"name\": \"CSV Output\",\n        \"active\": true,\n        \"tosidebar\": true,\n        \"console\": false,\n        \"tostatus\": false,\n        \"complete\": \"true\",\n        \"targetType\": \"full\",\n        \"statusVal\": \"\",\n        \"statusType\": \"auto\",\n        \"x\": 500,\n        \"y\": 220,\n        \"wires\": []\n    }\n]\n```\n\n### Reading JSON File and Converting to CSV\n\n```json\n[\n    {\n        \"id\": \"c3f2187d.f17ca8\",\n        \"type\": \"file in\",\n        \"z\": \"2b9467c1.b7c8c8\",\n        \"name\": \"Read JSON File\",\n        \"filename\": \"data.json\",\n        \"format\": \"utf8\",\n        \"chunk\": false,\n        \"sendError\": false,\n        \"encoding\": \"none\",\n        \"x\": 140,\n        \"y\": 320,\n        \"wires\": [\n            [\n                \"d7f4d89d.cb4b58\"\n            ]\n        ]\n    },\n    {\n        \"id\": \"d7f4d89d.cb4b58\",\n        \"type\": \"papaunparse\",\n        \"z\": \"2b9467c1.b7c8c8\",\n        \"name\": \"\",\n        \"header\": true,\n        \"skipEmptyLines\": true,\n        \"delimiter\": \",\",\n        \"newline\": \"\",\n        \"quoteChar\": \"\\\"\",\n        \"escapeChar\": \"\\\"\",\n        \"columns\": \"\",\n        \"x\": 330,\n        \"y\": 320,\n        \"wires\": [\n            [\n                \"e9347a9a.41c7b8\"\n            ]\n        ]\n    },\n    {\n        \"id\": \"e9347a9a.41c7b8\",\n        \"type\": \"file\",\n        \"z\": \"2b9467c1.b7c8c8\",\n        \"name\": \"Write CSV File\",\n        \"filename\": \"data.csv\",\n        \"appendNewline\": false,\n        \"createDir\": false,\n        \"overwriteFile\": \"true\",\n        \"encoding\": \"none\",\n        \"x\": 500,\n        \"y\": 320,\n        \"wires\": []\n    }\n]\n```\n\n## License\n\nISC","readmeFilename":"README.md"}