Shree krishna lamichhane
Shree Krishna Lamichhane

Shree Krishna Lamichhane

Hide Console Warning messages from xmldom in NodeJS

Shree krishna lamichhane
·Feb 24, 2022·

1 min read

Subscribe to my newsletter and never miss my upcoming articles

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);
    },
  },
});
 
Share this