A stream is an abstract interface for working with streaming data in Node.js. The stream module provides a base API that makes it easy to build objects that implement the stream interface.
Questions tagged [nodejs-stream]
306 questions
1
vote
1 answer
How to properly close a writable stream in Node js?
I'm quite new to javascripts. I'm using node js writable stream to write a .txt file; It works well, but I cannot understand how to properly close the file, as its content is blank as long as the program is running. More in detail I need to read…

aka.Calamaro
- 33
- 9
1
vote
1 answer
Saving canvas readable stream from createPNGStream into a variable
I am using canvas npm for create images, and trying to convert to readable stream and put it in a variable seems to corrupt.
This is how I save it:
let fullStream;
let stream = canvas.createPNGStream(null, { quality: 1 })
…

Pedro.js
- 21
- 4
1
vote
1 answer
How can I close the axios response stream based on some condition at server side?
I want to close the Axios response stream based on some conditions. I am not able to do this by passing the callback
const response = await axios({
method: 'get',
signal,
url: this.url,
…

Vimox Shah
- 99
- 1
- 9
1
vote
1 answer
Node.js - MaxListenersExceededWarning - when writing a Node.js CLI application uisng readline module
I am trying to keep adding numbers in a loop as shown in the code below:
const readline = require('readline');
const askOnCommandLine = (question) =>
new Promise((resolve) => {
const p = readline.createInterface({
input: process.stdin,
…

thewebjackal
- 785
- 8
- 17
1
vote
1 answer
How do you work with 2 large streams from different sources with nodejs?
I am working to create a report engine for multiple application, from multiple database in NodeJS. The problem is, I can't think of any way to merge 2 big data sets into one data without waiting for both streams to finish..
For example, this is my…

Magician
- 1,944
- 6
- 24
- 38
1
vote
1 answer
Nodejs how to fixed EPERM when unlink file while streaming
I made a transform stream that throws error, error is caught and i need to delete created file, but i get "EPERM: operation not permitted, unlink" when fs.unlink(outPath)
const fs = require('fs');
const http = require('http');
const stream =…

Artem Skibin
- 111
- 4
1
vote
2 answers
How to perform http2 requests to ksqldb in Node.js
I'm trying to figure out how to make http2 requests to ksqldb. I found this project which successfully does it (I adapted to it to js code below). However, this code is using async generators while I want to create a simple client which makes a…

hitchhiker
- 1,099
- 5
- 19
- 44
1
vote
2 answers
mssql - uncaughtException in Stream Mode
I'm facing the same issue as mentioned here:
When trying to use stream and query a table without mentioning the schema.
Something like select * from table instead of select * from schema_name.table. I get the following error:
mssql uncaughtException…

Oron Bendavid
- 1,485
- 3
- 18
- 34
1
vote
0 answers
Node JS stream duplicates data
I am currently working on a project where I have to read a large .csv file and upload its contents in a MongoDB collection. To read the CSV files, I am using the @fast-csv/parse npm module. Also, I am using node js stream API to pause the streaming…

h_a
- 119
- 2
- 8
1
vote
1 answer
Lambda stream encoded string
I stored the audio file in an array buffer and encoded it with base64. I need to send the data from the lambda to react client. For the larger audio files, I'm facing a lambda payload limit error.
Is there any way to stream the data in chunks from…

Pat Cummins
- 57
- 6
1
vote
1 answer
nodejs createWriteStream in nested for
I need to generate a huge number of combinations of string values, a few billion of lines and write them all in one large file to disk without the process being blocked.
At this moment it works until the file write buffer is filled, for little lists…

stefcud
- 2,220
- 4
- 27
- 37
1
vote
0 answers
How to implement Session authentication using node js and PostgreSQL
First Time I implementing Session Authentication using Node JS and PostgreSQL. In this implementation I facing an issue in backend side i have a /login endpoint. In this endpoint user login successfully It will generated session_id and stored on the…

hari prasanth
- 716
- 1
- 15
- 35
1
vote
1 answer
Add transform before write stream
I have a function e.g.
function writeToStream(writeStream) {
writeStream.write("test\n");
}
How can I make this apply a transform before writing to the final destination? Note: I don't have control over the writeToStream function, I just want to…

Colin D
- 2,822
- 1
- 31
- 38
1
vote
0 answers
Convert internal.Writable to NodeJS.WritableStream
I want to output sound to my speaker using ytdl-core and fluent-ffmpeg
I get the sound from yt and use ffmpeg to convert it to pcm and now i want to pipe it to my speaker
speaker uses internal.Writable
naudiodon uses NodeJS.WritableStream
when…

kaaaxcreators
- 123
- 9
1
vote
1 answer
generated sitemaps are corrupted using sitemap library for node/js
I'm using a library called sitemap to generate files from an array of objects constructed during runtime. My goal is to upload these generated sitemaps to an S3 bucket.
So far, the function is hosted on AWS lambda and uploading generated files…

Omar Dulaimi
- 846
- 10
- 30