Questions tagged [nodejs-stream]

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.

306 questions
1
vote
1 answer

What generally could be the cause of `on("end")` handler has not been called in Gulp pipeline?

Without the MWE, I don't expect that someone will answer exactly what is the cause in my case. What I am asking is what generally could be the cause. Knowing this, I'll continue the investigation myself. Below is not the working example, but If to…
Takeshi Tokugawa YD
  • 670
  • 5
  • 40
  • 124
1
vote
0 answers

How to stream Mysql query result in node js and close if some forceclose event is received

i've a business logic to implement that entails fetching huge amount of data from mysql table approximately 1 billion.After fetching the record i've to hit an api of another system with each row.I've tried to implement it using stream.Now i am…
Benson OO
  • 477
  • 5
  • 22
1
vote
1 answer

Creating a Readable stream from emitted data chunks

Short backstory: I am trying to create a Readable stream based on data chunks that are emitted back to my server from the client side with WebSockets. Here's a class I've created to "simulate" that behavior: class DataEmitter extends EventEmitter { …
mstephen19
  • 1,733
  • 1
  • 5
  • 20
1
vote
0 answers

Read data from Stream.Writable nodejs

I am pretty new to JS and am having trouble getting the data from Stream.Writable. The code I have looks something like this: const outputStream = new Stream.Writable(); // Other things push data into the Writable stream here // Get the…
Abraham
  • 185
  • 1
  • 10
1
vote
1 answer

Get data from Stream.Writable into a string variable

I am using the @kubernetes/client-node library. My end goal is to execute commands (say "ls") and get the output for further processing. The .exec() method requires providing two Writeable streams (for the WebSocket to write the output to), and one…
Abraham
  • 185
  • 1
  • 10
1
vote
1 answer

Why are chunks out of order when using stream.Readable.from?

I would assume when reading the chunks, it would start with 'applesauce', 'blueberry', etc. but instead the iterable that was used to initially create the stream is always last rather than first, despite the pushes being in the correct order. Can…
1
vote
1 answer

Issue with unit testing a unzip method node/jest

I have a small function designed to unzip a file using 'unzipper' and extract to a given location. when unit testing the function times out, for unit testing I am using jest. see below code : exports.unzipFile = async (folderPath) => { …
1
vote
1 answer

Use Read Stream from AWS S3 getObject to read and upload to a different bucket

I am trying to read a file from a third party AWS S3 bucket which is in a .gz format. I need to process the data in the file and upload the file to our own S3 Bucket. For reading the file, I am creating a readStream from S3.getBucket as shown…
Rachit Anand
  • 616
  • 5
  • 16
1
vote
1 answer

Not able to stream object array from transform stream nodejs

I am trying to read an array of objects, transform them and write to a file in Nodejs, it is giving me error "The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Object" My demo Code: const…
1
vote
1 answer

stream.write This expression is not callable

I am trying to a write a function that takes either writeable stream (createWriteStream) or process.stdout/.stderr but typescript keeps throwing this error. Error goes away when I do conditional type check. import { createWriteStream, WriteStream }…
bogdanoff
  • 1,705
  • 1
  • 10
  • 20
1
vote
0 answers

How to overlay audio streams on each other

I have a bunch of audio streams, i want to overlay them all on each other and make one final stream audio stream. This is how it would look visually So in the final stream, it would be like all of the previous audio streams are playing together. How…
domaxon
  • 11
  • 1
1
vote
1 answer

Nodejs getting error while download files using FTP

I am using node-ftp package for FTP connection. Below code example const FTPClient = require('ftp'); const fs = require("fs"); let ftp_client = new FTPClient(); let ftpConfig = { host: '94.208.170.184', port: 21, user: '99*******', …
Sudhir
  • 835
  • 11
  • 31
1
vote
1 answer

what's differnce between push() and callback in nodejs Transform

i'm implementing a Transform stream which is piped by mongoose cursor (which works like readable stream, (or maybe it's real readable stream)) const myTransform = new Transform({ readableObjectMode: true, writableObjectMode: true, …
Bad Dobby
  • 811
  • 2
  • 8
  • 22
1
vote
0 answers

When processing the stream of nodejs, the flow is stopped, but it is not stopped immediately when the asynchronous function is called

I'm processing thousands of data through a stream Connect and process multiple streams consisting of readable and transform The problem occurs in the pipe that updates the data in the db. The logic of the pipe continues to put the processed data…
1
vote
0 answers

How to abort uploading a stream to google storage in Node.js

Interaction with Cloud Storage is performed using the official Node.js Client library. Output of an external executable (ffmpeg) through fluent-ffmpeg is piped to a writable stream of a Google Cloud Storage object using…
AKd
  • 501
  • 4
  • 17