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
0
votes
0 answers
How to run server.js file in nodejs
Tried to run nodejs application.If i run node server.js i am getting module not found error.All files path is correct but i am getting module not found error.How to resolve this issue?
I have shared the errors below with folder structure:
Folder…

Nila Vaani
- 203
- 1
- 8
- 27
0
votes
1 answer
How to know the size of an HTTP request before it reaches its destination?
I am studying NodeJS and I have learned about streams and buffer. I found it very interesting because it occurred to me to use it on an HTTP server, since if a request is too big, the data can be sent little by little, especially when using the verb…

Diesan Romero
- 1,292
- 4
- 20
- 45
0
votes
0 answers
Copy file to NFS NAS using nodejs with read/write stream wrapped in promise
I am trying to copy a file to a NFS mounted directory using nodejs (basic working code below). While the file is successfully copied to the NFS mount, the promise chain breaks without throwing any error (nothing else in the promise chain executes).…

Informagician
- 305
- 3
- 15
0
votes
1 answer
Impossible to redirect video stream after conversion (mkv to mp4)
I'm currently realising a school project which aims a streaming video website (like Netflix) using torrent-stream (with the magnet link). I am using NodeJS for the stream part.
My problem is : I can't redirect the stream to the HTML 5 player while…

aagrios
- 87
- 1
- 8
0
votes
1 answer
Upload to Google Cloud Storage in a "For Loop" (async)
I am new to Javascript. I'm trying to make a loop that uploads the images to Google Cloud Storage. With this code, the image is uploaded correctly. The problem is that the path (URL) is not saved in the database AFTER the upload.
I tried using async…

Picki
- 469
- 4
- 11
0
votes
2 answers
I need to validate first four digits in a phone number which should be "5678" in Node Js. How should i do it? Which Validator library should i use
I need to validate the first four digits in a phone number which should be "5678" in nodeJs how should I do it. Which validator library should I use

Amaan Imtiyaz
- 254
- 6
- 16
0
votes
2 answers
Node js code in which i want to learn how to tackle asynchronous code
setTimeout(()=>{
console.log('time out')
},3000)
}
go();
console.log('app')
This is asynchronous code, I want to print app after the delay, but as we know "app" is printed first then "time out".

Amaan Imtiyaz
- 254
- 6
- 16
0
votes
2 answers
What is the optimal way of merge few lines or few words in the large file using NodeJS?
I would appreciate insight from anyone who can suggest the best or better solution in editing large files anyway ranges from 1MB to 200MB using nodejs.
Our process needs to merge lines to an existing file in the filesystem, we get the changed data…

user1595858
- 3,700
- 15
- 66
- 109
0
votes
0 answers
nodejs project unable to upload image to google cloud storage by the application hosted on google compute engine,local setup is able to upload file
When I trying to upload the file by the below code and able to do that in my local dev environment by when I use code and upload it to the server I am not able to get the response and I get an error - 500, Internal Server Error. I need help in this…

Prakash Choudhary
- 143
- 11
0
votes
3 answers
Delay processing of stream.Transform items
Say we have a simple node.js transform stream:
export class JSONParser extends stream.Transform {
constructor() {
super({objectMode: true});
}
}
I want to process items synchronously for awhile and then delay the remainder. Something like…
user11810894
0
votes
1 answer
Cannot set headers after they are sent to the client error while streaming the response using res.write
I am trying to stream the response from express using res.write method. Below is my code, I am getting "Cannot set headers after they are sent to the client" error when I hit the server. I am trying to stream each entry of the array. Can someone…

yondu_udanta
- 797
- 1
- 6
- 13
0
votes
1 answer
Restructure json based on actual and expected data
I want to restructure json based on original json data and the expected json data.
If you look closely in the original json data I have country outside of the Male/Female attributes. I would want the country module to be inside the Male/ Female…

Eva
- 109
- 9
0
votes
1 answer
Download image and resize in nodejs
What I am trying to do is download an image from google into my system repository in the project folder /download. Next, I am trying to get the image from the download repository and resize and again save the resized image in /thumbnail repository.…

rji rji
- 697
- 3
- 17
- 37
0
votes
1 answer
node.js synchronous file reading operation problem?
Problem Statement:
Complete function readFile to read the contents of the file sample.txt
and return the content as plain text response.
Note:
make sure when you read file mention its full path.
for e.g - suppose you have to read file…

Manab Das
- 111
- 1
- 4
0
votes
1 answer
How to send mailt without authentication using nodemailer
I tried to send mail without authentication but its throwing error how to achieve it.
mail.js
var transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: params.email,
…

hari prasanth
- 716
- 1
- 15
- 35