Now that I've realized that executing a function like
let parser = new DOMParser();
works only when it's executed with a browser, but not with a server like Express/Node, then, what are the options?
I've read many posts with NodeJS alternatives to DOMParser, but then there're the libraries
https://www.npmjs.com/package/dom-parser
https://www.npmjs.com/package/dom-node-iterator
Are these ones valid alternatives? Do I install them and adapt the method calls depending on whether it is the browser or Node the one that uses them?
I'm asking because looking at posts like this one HTML-parser on Node.js it doesn't seem so simple