LaTeX2Image allows LaTeX math equations to be exported directly to multiple image formats, and saved for use in other documents.
The full source code is available on GitHub. Behind the scenes, a Node.js app starts an isolated Docker container with a LaTeX installation for each request, compiling the generated .tex file and converting it to an SVG vector image. If required, the SVG file is then converted to a raster image format.