How can Node.js (or any other engine) "run" (process, evaluate) HTML or SVG files with embedded JavaScript (that modifies the DOM) and output the resulting document?
CodePudding user response:
It can't. A JavaScript engine by itself has no notion of the HTML or SVG DOM. It would need additional libraries (see comments).
The alternative is to use a Browser to evaluate the file without rendering it ("headless" mode).