node.js-stream Questions

3

Solved

I'd like to combine two Node.js streams into one by piping them, if possible. I'm using Transform streams. In other words, I'd like my library to return myStream for people to use. For example the...
Cracker asked 4/7, 2013 at 13:32

6

Solved

I'm attempting to unit test one of my node-js modules which deals heavily in streams. I'm trying to mock a stream (that I will write to), as within my module I have ".on('data/end)" listeners that ...
Lafollette asked 15/10, 2015 at 6:4

3

Solved

I want to pipe data from an amazon kinesis stream to a an s3 log or a bunyan log. The sample works with a file write stream or stdout. How would I implmeny my own writable stream? //this works va...
Puberulent asked 31/1, 2014 at 22:55

3

Solved

I have a stream that may or may not have already ended. If it has ended, I don't want to sit there forever waiting for the end event. How do I check?
Spathic asked 27/8, 2015 at 22:20

3

How can I transform a node.js buffer into a Readable stream following using the stream2 interface ? I already found this answer and the stream-buffers module but this module is based on the stream...
Angeliaangelic asked 16/4, 2013 at 13:41

3

Solved

The goal is to: Create a file read stream. Pipe it to gzip (zlib.createGzip()) Then pipe the read stream of zlib output to: 1) HTTP response object 2) and writable file stream to save the gzipp...
Overhear asked 5/1, 2013 at 15:55

7

Solved

I need to run two commands in series that need to read data from the same stream. After piping a stream into another the buffer is emptied so i can't read data from that stream again so this doesn'...
Phylis asked 23/10, 2013 at 22:56

4

Solved

As the documentation says, they both deal with transforming non-stream plugins to stream. What I try to understand is, if I can use the .pipe() method on something, doesn't it mean it's a stream? ...
Rheometer asked 23/2, 2015 at 21:37

1

I'm currently trying to use the HTML video player to stream a file from the file system in Electron. I would like to start streaming as the file is downloading. I'm not sure if my current plan wil...

2

Solved

Starting off with a basic node app, and I can't figure out how to beat this "write after end" error, even with the callbacks suggested on several sites. index.js: var server = require("./server")...
Campbell asked 1/9, 2016 at 1:32

1

I have a child Node process that runs on a CRON once every 24 hours. When the process begins, it reads some queued up data and shoves that data down some transform stream. This stream then acts as ...
Driedup asked 2/3, 2016 at 20:2

2

I'm trying to understand node streams and their life-cycle. So, I want to split the content of a stream for n-parts. The code below is just to explain my intentions and to show that I already try s...
Housebound asked 26/4, 2017 at 10:17

1

Solved

Is there an elegant way to determine if a stream is process.stdout I am working with streams and will like to end the stream, but found out that if the stream is process.stdout an error is thrown ...
Teneshatenesmus asked 7/1, 2017 at 13:0

1

I'm curious about my PassThrough stream and why it isn't closing after a resource I pipe it to closes. I'm using it as a mediator, one resource needs a ReadableStream and I need to pass the user a ...
Hallucinate asked 15/12, 2016 at 3:18

3

We can access local module using require function but cannot access global module through it. I read somewhere that to use global module we need to make it local then import it through require fun...

2

Solved

I have got stream and I need to get stream content into string. I stream from internet using http.get. I also write stream into file, but I don't want to write file and after that open the same fil...
Matisse asked 2/7, 2013 at 8:16

2

Solved

I have a REST method that should return a JSON array with certain elements that are read from mongodb (using mongoose). It should be very simple (in the real case the find method has arguments, bu...
Mantra asked 27/2, 2015 at 17:28

2

Solved

(new information below) I am trying to set up a lambda function that reacts to uploaded tgz files by uncompressing them and writing the results back to S3. The unzip and untar work fine, but upload...
Bauhaus asked 24/2, 2015 at 5:3

3

Solved

I have been trying to use a readable and a transform stream to process a very large file. The problem that I seem to come across is that if I don't put a writable stream at the end, the program see...
Jonquil asked 4/8, 2015 at 15:34

1

Solved

I'm trying to extract a .tar file(packed from a directory) and then check the names of the files in the extracted directory. I'm using tar-fs to extract the tar file and then use fs.createReadStrea...
Creech asked 5/8, 2015 at 2:40

2

var fs = require('fs'); var file = fs.createReadStream('./zeros.txt'); var dataSize = 0; file.on('readable', function () { var data = file.read(10); console.log('readable size = ', data.length)...
Quagmire asked 4/2, 2014 at 9:59

1

Premise I'm trying to find the correct way to prematurely terminate a series of piped streams (pipeline) in Node.js: sometimes I want to gracefully abort the stream before it has finished. Specifi...
Vadim asked 6/11, 2014 at 2:27

2

Solved

Suppose I have created a transform stream called Parser which can be written to like a normal stream but is read from as an object stream. I am using the readable event for the code that uses this ...
Biotype asked 4/5, 2014 at 5:8

1

Solved

The node.js API documents using an extra stdio (fd=4) when spawning a child process: // Open an extra fd=4, to interact with programs present a // startd-style interface. spawn('prg', [], { stdio...
Split asked 20/1, 2014 at 21:38

2

Solved

Confused by Node's filesystem parsing. Here's my code: var fs = require('fs'), xml2js = require('xml2js'); var parser = new xml2js.Parser(); var stream = fs.createReadStream('xml/bigXML.xml'); ...
Shelton asked 16/12, 2013 at 3:42

© 2022 - 2024 — McMap. All rights reserved.