'Electron cache images and then read it when the image is used

When electron starts, the cache images is read, and then read it when the image is used.

i can save images in main process.

fetch(`${server_host_ip}${image}`)
  .then(res => {
    let dest = fs.createWriteStream(p);
    if (res.body instanceof Readable) {
      res.body.pipe(dest);
    }
  });

but how to read it in renderer process.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source