Skip to main content

Hide Console Warning messages from xmldom in NodeJS

Published 1 min readMarkdown

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

About the author

  • 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.

No comments yet. Be the first to comment.

More from this blog