Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
node-red-contrib-bigcsv
Advanced tools
Readme
"CSV" parser for node-red. Original work by IBM dosnt' fit my needs. Buggy with multi-line and no huge file support. Here is a version working with a state for the art library (csv-parse) and working with my bigfile library
npm install node-red-contrib-bigcsv
Known issue: work with node v4
Core provides a CSV parser. This one is able to parse multi-line.
See biglib for details on Big Nodes.
Big Lib
and subsequent Big Nodes
are a family of nodes built for my own purpose. They are all designed to help me build a complete process for production purposes. For that I needed nodes able to:
All functionnalities are built under a library named biglib
and all Big Nodes
rely on it
Big CSV is a filter node for node-red to transform data into csv objects, one message per line. It uses the "csv-parse" library
It works as a filter node that means it takes in the output of a "big file" node or any block node. It's able to read a file by itself to send lines
It has several options as csv-parse offers them: (see http://csv.adaltas.com/parse/)
csv-parse CSV parsing implementing the Node.js stream.Transform API
biglib library for building node-red flows that supports blocks, high volume
Try pasting in the flow file below that shows the node behaviour
[{"id":"9c1f18d5.63e0e8","type":"comment","z":"b4b0c2a3.4b4f4","name":"Big CSV node sample usage","info":"","x":146.5,"y":41,"wires":[]},{"id":"d3cf8795.2c3078","type":"inject","z":"b4b0c2a3.4b4f4","name":"GO","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":410,"y":100,"wires":[["c7e57a1f.381a88"]]},{"id":"c7e57a1f.381a88","type":"function","z":"b4b0c2a3.4b4f4","name":"sample data","func":"msg.payload = \"Col1,Col2,Col3\\nVal1,\\\"Val\\\"\\\"3\\\"\\\"\\\",Val3\\nThis,is a,\\\"multi\\nline\\\"\\n1,2,2016-01-02\"\nreturn msg;","outputs":1,"noerr":0,"x":590,"y":200,"wires":[["819bdae5.7e6428"]]},{"id":"bcabd332.43543","type":"debug","z":"b4b0c2a3.4b4f4","name":"csv object","active":true,"console":"false","complete":"payload","x":970,"y":260,"wires":[]},{"id":"a780465.f587fb8","type":"debug","z":"b4b0c2a3.4b4f4","name":"status","active":true,"console":"false","complete":"control","x":950,"y":360,"wires":[]},{"id":"83781490.7c87e8","type":"inject","z":"b4b0c2a3.4b4f4","name":"GO with parsing","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":140,"y":240,"wires":[["279f5508.d860aa"]]},{"id":"5071718b.af8e9","type":"inject","z":"b4b0c2a3.4b4f4","name":"GO with no parsing","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":150,"y":340,"wires":[["9ab9cd9c.65463"]]},{"id":"9ab9cd9c.65463","type":"function","z":"b4b0c2a3.4b4f4","name":"auto_parse=false","func":"msg.config = { auto_parse: false }\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":300,"wires":[["c7e57a1f.381a88"]]},{"id":"279f5508.d860aa","type":"function","z":"b4b0c2a3.4b4f4","name":"auto_parse=true","func":"msg.config = { auto_parse: true, auto_parse_date: true }\nreturn msg;","outputs":1,"noerr":0,"x":334.5,"y":200,"wires":[["c7e57a1f.381a88"]]},{"id":"aae3d444.551c28","type":"comment","z":"b4b0c2a3.4b4f4","name":"This node accepts on the fly configuration","info":"","x":186,"y":164,"wires":[]},{"id":"8a707fdb.758f8","type":"comment","z":"b4b0c2a3.4b4f4","name":"3 lines of data with 1 multi line","info":"","x":640,"y":160,"wires":[]},{"id":"4b231890.b4dce8","type":"comment","z":"b4b0c2a3.4b4f4","name":"control messages (start, stop, ...)","info":"","x":1030,"y":400,"wires":[]},{"id":"1205b30.fedfa4d","type":"comment","z":"b4b0c2a3.4b4f4","name":"One message per line","info":"","x":1000,"y":220,"wires":[]},{"id":"506c748b.af938c","type":"comment","z":"b4b0c2a3.4b4f4","name":"Simple trigger","info":"","x":430,"y":60,"wires":[]},{"id":"16b73073.e948d","type":"inject","z":"b4b0c2a3.4b4f4","name":"GO with an error","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":140,"y":400,"wires":[["e2c2d0e9.1d3d3"]]},{"id":"e2c2d0e9.1d3d3","type":"function","z":"b4b0c2a3.4b4f4","name":"Non existing file","func":"msg.filename = \"/A/Probably/Non/Existing/File\"\nreturn msg;","outputs":1,"noerr":0,"x":580,"y":400,"wires":[["819bdae5.7e6428"]]},{"id":"819bdae5.7e6428","type":"bigcsv","z":"b4b0c2a3.4b4f4","name":"","filename":"","x":780,"y":300,"wires":[["bcabd332.43543"],["a780465.f587fb8"]]},{"id":"50fc0dc5.af03f4","type":"comment","z":"b4b0c2a3.4b4f4","name":"See the numbers...","info":"","x":367.5,"y":236,"wires":[]}]
This code is Open Source under an Apache 2 License.
You may not use this code except in compliance with the License. You may obtain an original copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Please see the License for the specific language governing permissions and limitations under the License.
Please report any issues or suggestions via the Github Issues list for this repository.
For more information, feedback, or community support see the Node-Red Google groups forum at https://groups.google.com/forum/#!forum/node-red
FAQs
A Big CSV parser
The npm package node-red-contrib-bigcsv receives a total of 11 weekly downloads. As such, node-red-contrib-bigcsv popularity was classified as not popular.
We found that node-red-contrib-bigcsv demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.