Gathering detailed insights and metrics for node-red-contrib-chunks-to-lines
Gathering detailed insights and metrics for node-red-contrib-chunks-to-lines
Gathering detailed insights and metrics for node-red-contrib-chunks-to-lines
Gathering detailed insights and metrics for node-red-contrib-chunks-to-lines
Node-RED node to read line by line from a stream of chunks of text.
npm install node-red-contrib-chunks-to-lines
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (58.8%)
HTML (34.71%)
Shell (6.49%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
6 Stars
50 Commits
4 Forks
4 Watchers
2 Branches
20 Contributors
Updated on May 21, 2025
Latest Version
0.8.1
Package Id
node-red-contrib-chunks-to-lines@0.8.1
Unpacked Size
21.02 kB
Size
6.63 kB
File Count
5
NPM Version
9.8.1
Node Version
18.18.0
Published on
Oct 11, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Node-RED node to read line by line from a stream of chunks of text, for instance from a node-red-contrib-ui-upload widget.
This node takes a stream of chunks of data as input, from which it outputs lines of text in a controlled manner.
There is indeed a built-in back-pressure / flow-control mechanism to optimise buffering and avoid memory exhaustion, by waiting for a tick before sending the next message.
This node is compatible with the conventions used by core nodes such as split and join to work with sequences. For instance, this node can consume data coming from a node-red-contrib-ui-upload.
Example: flow.json
Each received message is expected to be a chunk of a larger document.
This node expects messages with a msg.payload
containing either a string (when transmitting ASCII/ANSI text) or TypedArray / Uint8Array (when transmitting multi-byte text such as Unicode UTF-8).
This node will obey the sequence information provided in msg.parts
and msg.complete
.
Finally, this node also awaits another type of messages containing a truthy msg.tick
before releasing the next message.
This node will output either one line at a time (when n=1 in corresponding option) or an array of lines, in a format (text, CSV, JSON) defined in the options.
The messages will contain updated sequence information in msg.parts
and msg.complete
.
Example for CSV processing (splitting a large CSV file as smaller CSV chunks) for mass insertion into a PostgreSQL database, inserting many lines at a time to improve performances: flow-sql.json
See the full description of the example of upload of a large CSV file to an SQL database.
Output n lines at a time:
Output format:
msg.parts
information.Text decoding (from binary)
This node supports backpressure / flow control: it can wait for a tick before releasing the next batch of lines, to make sure the rest of your Node-RED flow is ready to process more data (instead of risking an out-of-memory condition), and also conveys this information upstream.
So this node will only output one message at first, and then await a message containing a truthy msg.tick
before releasing the next message.
To make this behaviour potentially automatic (avoiding manual wires), this node declares its ability by exposing a truthy node.tickConsumer
for downstream nodes to detect this feature,
and a truthy node.tickProvider
for upstream nodes.
Likewise, this node detects upstream nodes using the same back-pressure convention, and automatically sends ticks when its internal buffer is getting low, to ask for the next chunk of data. This is done for instance with the node-red-contrib-ui-upload widget.
As a side note, several instances of this node can be chained to test this mechanism.
This node can also be used from the command line:
1printf '{"payload":"A;B;C\\n1;2;3\\n4;5;6\\n7;8;9\\n10;11;12\\n"} \n {"tick": true} \n {"tick": true} \n' | \ 2 node ./index.js chunks-to-lines --linesFormat='"csv"' --nbLines='2'
Note: This is used for our automated test.
The CLI functionnality is provided by node-red-contrib-mock-cli.
License: Apache 2.0, 2020-2021.
Originally made by Alexandre Alapetite at the Alexandra Institute.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
4 existing vulnerabilities detected
Details
Reason
2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1
Reason
Found 0/24 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More