Cara menggunakan paket NPM di HTML

npm install the packages in the node_modules folder, the front end
cannot use it directly, you need ES6 syntax and import them by
using the following code:

import html2cavas from "html2cavas"

then you need to use Babel to transpile your ES6 code to normal JS code
Here is the explanation:
https://hackernoon.com/use-es6-javascript-syntax-require-import-etc-in-your-front-end-project-5eefcef745c2

After that you can use the <script> tag to import the transpiled code
MitchAloha