I have a stream of data and I need to write it to nowhere, but without immediately stopping it. The code below writes to a file, so it keeps the connection alive for as long as the stream is going.
request
.get(href)
.on('response', function(response) {
console.log(response.statusCode)
console.log(response.headers['content-type'])
})
.pipe(fs.createWriteStream("name.mp3"))
Is it possible to pipe that stream to nowhere, while still keeping the connection like fs.createWritableStream
?
I tried using dev-null (npm package), but it seems to just kill the connection immediately.