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
0
votes
0 answers

Node JS stream sort big file

Thanks for helping! I have a global task - i need to sort big file, for example its 1gb and .csv (strings in file). Of course i must do it without using full memory, only via stream. The method of sorting is not important, i want by string.length. I…
Nikita P
  • 81
  • 4
0
votes
0 answers

How to await promise inside stream pipe

I am using createReadStream of file module. I have a async operation which is reading from redis/db and based on saved value, I have to increment different counters. This is done inside the stream. The problem is end event is called on stream before…
osama
  • 116
  • 1
  • 9
0
votes
1 answer

How to convert tensor to image in node.js and send it to client to download?

I have the following tensor in nodejs: I then encode it to PNG like so: const encodedTensor = await tf.node.encodePng(intTensor); And pipe it to the frontend like this: fs.writeFileSync("image.png", encodedTensor); const readStream =…
0
votes
0 answers

If I want to stream videos with multiple dubbings, do I need to store separate video file for each dubbing, or can I merge them while piping buffer?

I want to stream video using node js. If I want to include multiple dubbings, do I need to store separate video file for each dubbing, or can I merge them in runtime. If I can merge it while streaming, what package do I need?
0
votes
0 answers

Nodejs stream.pipe performing asynchronously

I have a large xml which is a combination of xml documents. I'm trying to use a nodejs xml splitter and respond back with the number of documents i have found. My code looks something like this. I'm looking to get the number of documents outside the…
Anupam Chand
  • 2,209
  • 1
  • 5
  • 14
0
votes
0 answers

Handling backpressure in custom NodeJS streams

I'm generally new to Node and JS but not to the idea of streams and backpressure. I've been making a Discord bot using discordjs and I'm facing a backpressure issue. I'm recording the User's voice in PCM format and I'm saving it to a…
Alex V.
  • 31
  • 4
0
votes
1 answer

How to make the node js code always run even if the system is shutdown

i have created the cron job using node js ,which have to run in the interval of every hour even if the system is shut down. It has to run automatically with out manual invoke of the code .Please help to solve this i have tried with pm2 but not…
0
votes
1 answer

Nodejs writable stream.write method creates a file but doesn't write in it

I tried with versions, 10/14/16 and I'm using a mac. My code base is quite complex, so I tried out something simple as below, yet nothing changed. Is there something, I'm missing out? ` const fs = require('fs'); const readableStream =…
0
votes
1 answer

How to make nodejs know about installed python

Whenever I run the nodejs msi file, it executes a powershell script, complains about not able to find the python and downloads a new version of python everytime. I have added python to my path and even made an environment variable pointing to the…
Tony
  • 81
  • 9
0
votes
0 answers

how to load data slowly like YouTube video as YouTube doesn't load all video as we scroll it loads data ,also Facebook in notifications

i am making an Doctor appointment App using MERN STACK and there i dr uploads video, for video i have used stream so video loads and server doesn't send entire length of video ,similarly now i have to load An Array objects data of notification from…
0
votes
0 answers

Understanding the order of Stream push() and 'data' event callbacks

I have the following code from the Stream library in Node. It's just for my understanding of how streams work. I dont understand the order in which the push and 'data' event callback occurs here, as shown in the output below. const r =…
sekaranp
  • 1
  • 1
0
votes
0 answers

mp4 video still downloading sometimes can watching it's contant sometimes not

i'm working in node js project that stream video from url ,but it's work only when the mp4 video can open while it's downloading[mean can watch it],if it's not it's will not work , it's work for all youtube video, so i want to know how to make all…
Bellator
  • 3
  • 1
0
votes
0 answers

Create an ongoing stream from buffer and append to the stream

I am receiving a base 64 encode string in my Nodejs server in chunks, and I want to convert it to a stream that can be read by another process but I am not finding how to do it. Currently, I have this code. const stream =…
james Makinde
  • 943
  • 3
  • 17
  • 36
0
votes
0 answers

Can't make a bot speak using Discord's websocket

This is my code: const WebSocket = require('ws'); const dgram = require('dgram'); const fs = require('fs'); function start(token, guild, endpoint, id, session) { console.log(token, guild, endpoint, id, session); console.log('Connecting to…
MegaPower
  • 1
  • 2
0
votes
0 answers

How can NodeJS keyboard text input go directly into a Buffer instead of a string?

I have been designing a system with some super careful cryptographic needs and decided that having the console app administrator type in a sensitive cryptographic password when the app calls for it might be the way to go in my use case. I was…
OCDev
  • 2,280
  • 3
  • 26
  • 37