MDX


Sync API

MDX processes everything asynchronously by default. In certain cases this behavior might not be desirable.

If you’re using the MDX library directly, you might want to process an MDX string synchronously. It’s important to note that if you have any async plugins, they will be ignored.

const fs = require('fs')
const mdx = require('@mdx-js/mdx')

const mdxText = fs.readFileSync('hello.mdx', 'utf8')

const jsx = mdx.sync(mdxText)

MDX’s runtime package has example usage.