How to use files content (image/pdf) form IPFS to create file in storage (basically downloading images/pdf from ipfs)

I am implementing Kubo RPC API in Node JS to upload files to IPFS, Uploads works, but when I try to get content of file using ifps.cat(CID) it returns may be plain text, stream or chunks (may be encoded, I don’t know which type of encoding is it.).

My question is how do I convert this data to a readable image or pdf, below code create image which is unreadable or pdf which is empty.
node JS

axios.post('http://127.0.0.1:5001/api/v0/cat?arg=QmYjChbAEthEYz7qiR8XHHFS9uRZcMsfZVukpAcCF4q6xw')
  .then(async function (response) {
    console.log(response.data);
    fs.writeFile("./myfile.png",response.data, (err) => {
      if (err) throw err;
      res.status(200).send("files saved.");
    });
  })
  .catch(function (error) {
    console.log(error);
    res.status(500).send(error);
  });

Console log

Related: node.js - How to use files content (image/pdf) form IPFS (basically downloading ipfs images/pdf) - Stack Overflow