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
2 answers
Exit node js when a stream that write json strings into mongodb finish its work
I use request module to download a zip file that cointain a .csv file, then i use pipe to read the content with unzip and split modules and then i parse and write result into mongodb with mongoose-object-stream module.
My code:
//index.js
var…

Francesco Bellavita
- 135
- 10
0
votes
1 answer
Data Ingestion - Massively Parallel processing with Concurrency
I am looking for a massively parallel processing system with concurrency which can provide seamless data ingestion solution for over a million IoT devices per 500 milli seconds.
Looking for open source highly scalable rich libraries of different…
0
votes
1 answer
Manage Cuncurent request process nodejs
Different users trying to access different application routes with heavy manipulation of data. At the mid time one of the request failed due to internal server error and my whole application has been crashed. Thats why other request has been failed…

narayansharma91
- 2,273
- 1
- 12
- 20
0
votes
1 answer
Check size of node js stream using socket.io-stream
I'm using socket.io-stream to upload a file, I want to know the size of data upload to limit.
This is my server code:
ss = require('socket.io-stream'),
SocketIo = require('socket.io'),
path = require('path'),
fs =…

Social Code
- 305
- 1
- 5
- 15
0
votes
0 answers
Nodejs - how to create transform stream that takes a JS object and converts to JSON
I have a readable stream that is giving me objects:
const readable = getReadableStream();
I can pipe that readable into a transform stream:
const t = new Transform({
objectMode: true,
transform(chunk, encoding, cb) {
…

Alexander Mills
- 90,741
- 139
- 482
- 817
0
votes
2 answers
In NodeJS, how do you print lines to a file without manually adding the new line character?
I'm trying to figure out how to simply write a string representing a line to a file, where whatever function I call automatically appends a newline character.
I've tried using the default NodeJS file system library for this but I can't get this to…

Charles Spencer
- 626
- 1
- 6
- 17
0
votes
2 answers
NodeJS: streaming multiple files from readstream (gridFS) to show on frontend
I have uploaded multiple image files into MongoDB using "Multer" and "multer-gridfs-storage". I want to extract these files and show them as thumbnails on the webpage. I have tried to extract these files into ReadStream and storing them into an…

gaurav tyagi
- 21
- 3
0
votes
0 answers
Retrieving key/value from form-data post from client
I write API in order to client upload file. API has content-type multiple/form-data. But I don't know get values from client send to my
router.post('/upload/file', async (req, res) => {
var body = "";
try {
req.on('data', function (chunk) {
…

TraiTran
- 63
- 1
- 6
0
votes
1 answer
fs.createReadStream('b.mp3') reduce latency
I'm playing around with events triggering sounds (500 msec long), therefore I use the lame library.
var lame = require('lame');
var fs = require('fs');
var Speaker = require('speaker');
while(listening) {
if(eventIsFired) {
…

Basti
- 606
- 1
- 12
- 22
0
votes
1 answer
Ensure that done() callback is being called in this Mocha test
Looking at other questions, can't really find the cause of the problem. I am trying to test using mocha.
it("Should not do the work",function(done) {
axios
.post("x/y",{ id:a2 })
.then(function(res) {
assert(false,"Should not do the…

daniel cliff
- 9
- 6
0
votes
1 answer
Node stream line-by-line: Can't set headers after they are sent
I try to read stream request line by line and use split module for it. But I got an error when I try set header connection:close when data is big!
Example code:
const http = require('http');
const split = require('split');
server.on('request',…

Avrel Dusop
- 135
- 3
- 11
0
votes
1 answer
Redirect azure stream to put request
I am trying to upload file from azure to external service -
var requestStream = request.put(requestParams, function (err, res, body){
if(err){
deffered.reject(err);
return;
…

Anton Putau
- 632
- 1
- 7
- 31
0
votes
2 answers
How to use rest api in client side?
Hello today I have simple code Nodejs express that work as rest api. It work when i use postman to send request as get method like code below. But i try use it in client. it doesn't work . So can you help find mistake,please?
// simple rest api…

chen rina
- 19
- 4
0
votes
1 answer
Hapijs Forwarding a stream to another server
I try to upload a image to my Hapijs Server via stream and send(pipe) the data to another Hapijs instance.
So I have this post Route, which should receive a stream and forward it:
this.server.route({
method: "POST",
path:…

laren0815
- 265
- 1
- 5
- 22
-1
votes
1 answer
Remove duplicates from a JSON file of huge size in NodeJs
I have a huge JSON file of size > 800 MB containing 70,000 records.
File content:
{
"rows": [
{"empId":"1014456","blockId":"b6566"},
{"empId":"1014456","blockId":"b6566"},
…

razor1911
- 63
- 7