Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

99
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda