Skip to main content

Command Palette

Search for a command to run...

Hide Console Warning messages from xmldom in NodeJS

Published
1 min read
S

I am CS Student currently perusing my bachelor degree. I love coding and implementing new logics. Aside from that I'm also a hardware lover and has great interest in IOT.

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);
    },
  },
});
60 views