This is an Emscripten port of the C reference implementation of CommonMark, cmark.
cmark-emscripten can be used in Node.js and the browser.
yarn add cmark-emscripten
const cmark = require('cmark-emscripten')
cmark.toHTML(`
What do you call a basement full of liberals?
---
*A whine cellar.*
`).then(console.log)
Outputs:
<h2>What do you call a basement full of liberals?</h2>
<p><em>A whine cellar.</em></p>