0

Is it possible to use parse5 in a typescript project? parse5 home page It was written in javascript and the documentation only uses javascript as well.

const parse5 = require('parse5')

If not I have had trouble finding anything that is as fully featured as that for typescript. The main feature I need is keeping track of the location in the DOM.

1 Answer 1

1

You can use any JavaScript package in TypeScript, as long as you have type definitions.

Many npm packages have corresponding type definitions (thanks to Definitely Typed) at @types/packagename (example: @types/parse5). Simply install the package (npm i -D @types/parse5) and TypeScript will automatically find the type definitions for parse5.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.