how-to-use-cjs-module-as-esm-module-in-node.js
CJS => ESM
dev
# yarn
$ yarn esm
$ yarn cjs
# npm
$ npm run esm
$ npm run cjs
demo
ESM
usages
import NextMdx from '@next/mdx'; // ✅
// ...
NextMdx()
OR
import * as NextMdx from '@next/mdx'; // ✅
// ...
NextMdx.default()