Hide Console Warning messages from xmldom in NodeJS

Here is the quick way to hide the warning xml parsing message using xmldom package in NodeJs.

var DOMParser = require("xmldom").DOMParser;
var parser = new DOMParser({
  locator: {},
  errorHandler: {
    warning: function (w) {},
    error: function (e) {},
    fatalError: function (e) {
      console.error(e);
    },
  },
});