Example typescript library that runs in both the browser and node.
Biggest gotcha is that the browser requires <script type="module"> for these, not just <script>. this lets the browser use import statements.
esm (import) and umd (require) modulesumd is compatible with both commonjs and amd, no need to build those explicitly"type": "module" in package.json makes a node project use esm instead of umd. it's a good default these days.esbuildGenerated using TypeDoc