{"id":13482753,"url":"https://github.com/micromark/micromark-extension-mdxjs","last_synced_at":"2025-10-29T20:42:37.703Z","repository":{"id":57296687,"uuid":"319739592","full_name":"micromark/micromark-extension-mdxjs","owner":"micromark","description":"micromark extension to support MDX.js","archived":false,"fork":false,"pushed_at":"2023-10-19T12:39:33.000Z","size":63,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-04-26T17:31:46.319Z","etag":null,"topics":["esm","expression","jsx","markdown","md","mdx","mdxjs","micromark","micromark-extension"],"latest_commit_sha":null,"homepage":"https://unifiedjs.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/micromark.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"unifiedjs","open_collective":"unified"}},"created_at":"2020-12-08T19:26:40.000Z","updated_at":"2024-06-18T18:41:07.011Z","dependencies_parsed_at":"2024-06-18T18:40:59.511Z","dependency_job_id":null,"html_url":"https://github.com/micromark/micromark-extension-mdxjs","commit_stats":{"total_commits":18,"total_committers":1,"mean_commits":18.0,"dds":0.0,"last_synced_commit":"aafdc2e819ca47a57cc59eaeefc9581395d8bb0d"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromark%2Fmicromark-extension-mdxjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromark%2Fmicromark-extension-mdxjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromark%2Fmicromark-extension-mdxjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromark%2Fmicromark-extension-mdxjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/micromark","download_url":"https://codeload.github.com/micromark/micromark-extension-mdxjs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248732484,"owners_count":21152852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esm","expression","jsx","markdown","md","mdx","mdxjs","micromark","micromark-extension"],"created_at":"2024-07-31T17:01:05.166Z","updated_at":"2025-10-29T20:42:37.624Z","avatar_url":"https://github.com/micromark.png","language":"JavaScript","funding_links":["https://github.com/sponsors/unifiedjs","https://opencollective.com/unified"],"categories":["JavaScript"],"sub_categories":[],"readme":"# micromark-extension-mdxjs\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n\n[micromark][] extensions to support [MDX][mdxjs].\n\n## Contents\n\n* [What is this?](#what-is-this)\n* [When to use this](#when-to-use-this)\n* [Install](#install)\n* [Use](#use)\n* [API](#api)\n  * [`mdxjs(options?)`](#mdxjsoptions)\n  * [`Options`](#options)\n* [Authoring](#authoring)\n* [Syntax](#syntax)\n* [Errors](#errors)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Security](#security)\n* [Related](#related)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package contains an extension that adds support for the syntax enabled\nby [MDX][mdxjs] to [`micromark`][micromark].\nThis extension is used inside MDX.\nIt supports export/imports, expressions, JSX, and turns some markdown features\noff.\n\n## When to use this\n\nThis project is useful when you want to support MDX.\n\nYou can use this extension when you are working with [`micromark`][micromark].\n\nThis package is aware of JavaScript syntax.\nIf you want to be unaware of JavaScript, for example because expressions can\ninclude Rust or variables or whatnot, use\n[`micromark-extension-mdx`][micromark-extension-mdx].\n\nAlternatively, you can also use the underlying syntax extensions separately:\n\n* [`micromark-extension-mdx-expression`][micromark-extension-mdx-expression]\n  — support MDX expressions\n* [`micromark-extension-mdx-jsx`][micromark-extension-mdx-jsx]\n  — support MDX JSX\n* [`micromark-extension-mdx-md`][micromark-extension-mdx-md]\n  — turn some CommonMark features off\n* [`micromark-extension-mdxjs-esm`][micromark-extension-mdxjs-esm]\n  — support MDX export/imports\n\nWhen you need a syntax tree, combine this package with\n[`mdast-util-mdx`][mdast-util-mdx].\n\nAll these packages are used in [`remark-mdx`][remark-mdx], which focusses on\nmaking it easier to transform content by abstracting these internals away.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install micromark-extension-mdxjs\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {mdxjs} from 'https://esm.sh/micromark-extension-mdxjs@2'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import {mdxjs} from 'https://esm.sh/micromark-extension-mdxjs@2?bundle'\n\u003c/script\u003e\n```\n\n## Use\n\n```js\nimport {micromark} from 'micromark'\nimport {mdxjs} from 'micromark-extension-mdxjs'\n\nconst output = micromark('import a from \"b\"\\n\\na \u003cb /\u003e c {1 + 1} d', {\n  extensions: [mdxjs()]\n})\n\nconsole.log(output)\n```\n\nYields:\n\n```html\n\u003cp\u003ea  c  d\u003c/p\u003e\n```\n\n…which is useless: go to a syntax tree with\n[`mdast-util-from-markdown`][mdast-util-from-markdown] and\n[`mdast-util-mdx`][mdast-util-mdx] instead.\n\n## API\n\nThis package exports the identifier [`mdxjs`][api-mdxjs].\nThere is no default export.\n\nThe separate extensions support the [`development` condition][development].\nRun `node --conditions development module.js` to get instrumented dev code.\nWithout this condition, production code is loaded.\n\n### `mdxjs(options?)`\n\nCreate an extension for `micromark` to enable MDX syntax.\n\n###### Parameters\n\n* `options` ([`Options`][api-options], optional)\n  — configuration; passed to all extensions\n\n###### Returns\n\nExtension for `micromark` that can be passed in `extensions` to enable MDX\nsyntax ([`Extension`][micromark-extension]).\n\n### `Options`\n\nConfiguration (TypeScript type).\n\n###### Type\n\n```ts\nexport type {Options} from 'micromark-extension-mdx-expression'\n```\n\nSee [`Options`][micromark-extension-mdx-expression-options].\n\n## Authoring\n\nFor recommendations on how to author MDX, see each corresponding readme:\n\n* [expressions](https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression#authoring)\n* [JSX](https://github.com/micromark/micromark-extension-mdx-jsx#authoring)\n* [ESM](https://github.com/micromark/micromark-extension-mdxjs-esm#authoring)\n* [CommonMark features not in MDX](https://github.com/micromark/micromark-extension-mdx-md#authoring)\n\n## Syntax\n\nFor info on the syntax of these features, see each corresponding readme:\n\n* [expressions](https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression#syntax)\n* [JSX](https://github.com/micromark/micromark-extension-mdx-jsx#syntax)\n* [ESM](https://github.com/micromark/micromark-extension-mdxjs-esm#syntax)\n* CommonMark features not in MDX: n/a\n\n## Errors\n\nFor info on what errors are thrown, see each corresponding readme:\n\n* [expressions](https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression#errors)\n* [JSX](https://github.com/micromark/micromark-extension-mdx-jsx#errors)\n* [ESM](https://github.com/micromark/micromark-extension-mdxjs-esm#errors)\n* CommonMark features not in MDX: n/a\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional type [`Options`][api-options].\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line,\n`micromark-extension-mdxjs@^2`, compatible with Node.js 16.\n\nThis package works with `micromark` version `3` and later.\n\n## Security\n\nThis package is safe.\n\n## Related\n\n* [`micromark-extension-mdx`][micromark-extension-mdx]\n  — support MDX unaware of JS\n* [`mdast-util-mdx`][mdast-util-mdx]\n  — support MDX in mdast\n* [`remark-mdx`][remark-mdx]\n  — support MDX syntax in remark\n\n## Contribute\n\nSee [`contributing.md` in `micromark/.github`][contributing] for ways to get\nstarted.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n\u003c!-- Definitions --\u003e\n\n[build-badge]: https://github.com/micromark/micromark-extension-mdxjs/workflows/main/badge.svg\n\n[build]: https://github.com/micromark/micromark-extension-mdxjs/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark-extension-mdxjs.svg\n\n[coverage]: https://codecov.io/github/micromark/micromark-extension-mdxjs\n\n[downloads-badge]: https://img.shields.io/npm/dm/micromark-extension-mdxjs.svg\n\n[downloads]: https://www.npmjs.com/package/micromark-extension-mdxjs\n\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size\u0026query=$.size.compressedSize\u0026url=https://deno.bundlejs.com/?q=micromark-extension-mdxjs\n\n[size]: https://bundlejs.com/?q=micromark-extension-mdxjs\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/micromark/micromark/discussions\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esmsh]: https://esm.sh\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[contributing]: https://github.com/micromark/.github/blob/main/contributing.md\n\n[support]: https://github.com/micromark/.github/blob/main/support.md\n\n[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[typescript]: https://www.typescriptlang.org\n\n[development]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions\n\n[micromark]: https://github.com/micromark/micromark\n\n[micromark-extension]: https://github.com/micromark/micromark#syntaxextension\n\n[micromark-extension-mdx]: https://github.com/micromark/micromark-extension-mdx\n\n[micromark-extension-mdx-expression]: https://github.com/micromark/micromark-extension-mdx-expression\n\n[micromark-extension-mdx-jsx]: https://github.com/micromark/micromark-extension-mdx-jsx\n\n[micromark-extension-mdx-md]: https://github.com/micromark/micromark-extension-mdx-md\n\n[micromark-extension-mdxjs-esm]: https://github.com/micromark/micromark-extension-mdxjs-esm\n\n[mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown\n\n[mdast-util-mdx]: https://github.com/syntax-tree/mdast-util-mdx\n\n[remark-mdx]: https://mdxjs.com/packages/remark-mdx/\n\n[mdxjs]: https://mdxjs.com\n\n[api-mdxjs]: #mdxjsoptions\n\n[api-options]: #options\n\n[micromark-extension-mdx-expression-options]: https://github.com/micromark/micromark-extension-mdx-expression/blob/main/packages/micromark-extension-mdx-expression/readme.md#options\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicromark%2Fmicromark-extension-mdxjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicromark%2Fmicromark-extension-mdxjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicromark%2Fmicromark-extension-mdxjs/lists"}