The README mentions that this project
Works with both the browser and node.js.
However the simple use section is only applicable to node.js. As someone fairly new to JavaScript/TypeScript, it would have been nice for there to be a section for use in the browser.
I did eventually figure out that I could successfully use
<script type="importmap">
{
"imports": {
"microformats-parser": "https://unpkg.com/[email protected]/dist/index.mjs",
"parse5": "https://unpkg.com/[email protected]/dist/index.js",
"entities": "https://unpkg.com/[email protected]/dist/esm/index.js",
"entities/lib/": "https://unpkg.com/[email protected]/dist/esm/"
}
}
</script>
<script type="module">
import { mf2 } from "microformats-parser";
globalThis.mf2 = mf2;
</script>
and then proceed with the simple use from there.