![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
line-readable-stream
Advanced tools
Provides a stream wrapper for a node.js Readable Stream for line-by-line reading
This is a port of bluesmoon's node-line.input-stream. Provides a stream wrapper for a node.js Readable Stream for line-by-line reading.
Node:
npm install line-readable-stream
Like Readable Stream with a line
event.
JavaScript:
var LineReadableStream = require('line-readable-stream');
var fs = require('fs');
var stream = new LineReadableStream(fs.createReadStream("foo.txt", { flags: "r" }));
stream.setEncoding("utf8");
stream.setDelimiter("\n"); // optional string, defaults to "\n"
stream.on("error", function(err) {
console.log(err);
});
stream.on("data", function(chunk) {
// You don't need to use this event
});
stream.on("line", function(line) {
// Sends you lines from the stream delimited by delimiter
});
stream.on("end", function() {
// No more data, all line events emitted before this event
});
stream.on("close", function() {
// Same as ReadableStream's close event
});
if(stream.readable) {
console.log("stream is readable");
}
// Also available: resume(), pipe()
TypeScript:
///<require path="typings/node/node.d.ts"/>
///<require path="node_modules/line-readable-stream/LineReadableStream.d.ts"/>
// If you know a better war to include the .ts file that comes with the npm package, let me know.
import LineReadableStream = require('node_modules/line-readable-stream/LineReadableStream');
import fs = require('fs');
var stream = new LineReadableStream(fs.createReadStream("foo.txt", { flags: "r" }));
stream.setEncoding("utf8");
stream.setDelimiter("\n"); // optional string, defaults to "\n"
stream.on("error", err => console.log(err));
stream.on("data", chunk => {
// You don't need to use this event
});
stream.on("line", line => {
// Sends you lines from the stream delimited by delimiter
console.log("Line: " + line);
});
stream.on("end", () => {
// No more data, all line events emitted before this event
});
stream.on("close", () => {
// Same as ReadableStream's close event
});
if(stream.readable)
console.log("stream is readable");
// Also available: resume(), pipe()
You can also attach listeners to any event specific to the underlying stream, ie,
you can listen to the open
event for streams created by fs.createReadStream()
or the connect
event for Net streams.
A side effect of this is that you can add a listener for any junk string and LineReadableStream
will
pretend that it worked. The event listener may never be called though.
line
handlerline-readable-stream
, you can delimit by any string, so for example, setting delimiter to "\n\n"
will read by paragraph (sort of)./[\r\n]+/
this
, so can be chainedFAQs
Provides a stream wrapper for a node.js Readable Stream for line-by-line reading
The npm package line-readable-stream receives a total of 4 weekly downloads. As such, line-readable-stream popularity was classified as not popular.
We found that line-readable-stream 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.