0

Hey i'm trying to use the DOMParser api inside a vscode extension that i'm making right now. vscode tells me it cant find the DOMParser instance and relevant methods when i try to use it. I managed to use a library to achieve parsing html.

I'm curious why the DOMParser api cant be used in the environment. Is it because it's not ran in an environment like the browser?

thanks.

moon
  • 23
  • 1
  • 8

1 Answers1

2

VS Code extensions are primarily built using Node.js, and it seems DOMParser is not available in Node.js. So, you should depend on some library.

In this post (https://stackoverflow.com/a/55668667/7758872) there is a lot of libraries for your to try out.

Hope this helps

alefragnani
  • 2,478
  • 11
  • 16