Shree krishna lamichhane
Shree Krishna Lamichhane

Follow

Shree Krishna Lamichhane

Follow

Hide Console Warning messages from xmldom in NodeJS

Shree krishna lamichhane's photo
Shree krishna lamichhane
·Feb 24, 2022·

1 min read

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