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/microformats-parser@2.0.4/dist/index.mjs",
"parse5": "https://unpkg.com/parse5@7.1.2/dist/index.js",
"entities": "https://unpkg.com/entities@6.0.0/dist/esm/index.js",
"entities/lib/": "https://unpkg.com/entities@6.0.0/dist/esm/"
}
}
</script>
<script type="module">
import { mf2 } from "microformats-parser";
globalThis.mf2 = mf2;
</script>
and then proceed with the simple use from there.
The README mentions that this project
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
and then proceed with the simple use from there.