I am creating a node.js application written in Typescript. Its one of the functionality is to parse HTML file. But I can't seem to find the HTML parser written in Typescript.
As, normal npm modules specified in HTML-parser on Node.js are not importing in my application.
I have tried installing the node.js module like
npm install domhandler
and, then imported the module in my main.ts file like
import * as parser from "htmlparser2"
It was throwing error
Cannot find module 'htmlparser2'
Is there any way I can import these normal npm modules in my Typescript node application?
Or, is there any typescript module which I can use to parse HTML file?
2.xof typescript then you simply need tonpm install @types/domhandlerto install the definition files for this module, otherwise you'll need to use typings.