If you're not looking to write a custom script today, there are excellent existing tools to bridge the gap: Generating an EPUB File in the Browser - Jim Nielsen's Blog
: Script the conversion of hundreds of posts in seconds. RSCE JS epub
: Let users "download as eBook" without needing a backend. If you're not looking to write a custom
: A powerful, modern choice that works in both Node.js and the browser. It automatically handles the fetching of images and fonts, which is often the most tedious part of the process. RSCE JS epub