Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

97
Views
Pipe ReadableStream to Transform

I have Node code that I honestly don't fully understand but AFAIK it streams and transforms the received data.

var download = got.stream(remoteURL, { isStream: true })

var resultTransform = new Transform({
        transform(chunk, encoding, callback) {
            ..
}
return download.pipe(resultTransform, { end: true })

I want to do the same in the browser.

What I am trying is

var download = await fetch(remoteURL)

..

console.log(typeof(download.body)) 
// "ReadableStream {locked: false}"

return download.body.pipeThrough(resultTransform) 
// "Failed to execute 'pipeThrough' on 'ReadableStream': Failed to read the 'readable' property from 'ReadableWritablePair': Failed to convert value to 'ReadableStream'"

Along with every combination with .body and .pipe.

I'm sure I am overcomplicating things there, how do I pipe the stream into the transform?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!