title: Streaming axios response from a get request in nodeJS
body: <p>I'm searching to send (return) a readableStream to a method (myMethod) with axios in a node program -&gt; i'd like to stream the response to a ReadableStream that I can use to send to the myMethod() callers :</p>
  <pre><code>// This code does'nt work but that's what I'm trying to do
  function myMethod() {
    var readableStream = createReadableStream(); // does not exists but that's here to show the concept
  
    const axiosObj = axios({ 
        method: 'get',
        url: 'https://www.google.fr',
        responseType: 'stream' 
    }).then(function(res) {
        res.data.pipe(readableStream);
    }).catch(function(err) {
        console.log(err);
    });
  
    return readableStream;
  }
  </code></pre>
  <pre><code>function myMethodCaller() {
     myMethod().on('data', function(chunk) {
        // Do some stuffs with the chunks
     });
  }
  </code></pre>
  <p>I know that we can only do in res.data a pipe to a writableStream. I'm stuck in returning a readableStream usable by the myMethod() callers. Have you got any ideas on that ?</p>
  <p>Regards,
  Blured.</p>