micromark extension to support MDX (agnostic to JavaScript)
Installations
npm install micromark-extension-mdx
Developer Guide
Typescript
Yes
Module System
ESM
Node Version
20.8.1
NPM Version
10.1.0
Score
91.3
Supply Chain
97.4
Quality
75.5
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
Download Statistics
Total Downloads
14,453,600
Last Day
2,636
Last Week
14,978
Last Month
65,822
Last Year
946,903
GitHub Statistics
MIT License
6 Stars
44 Commits
6 Watchers
1 Branches
11 Contributors
Updated on Sep 02, 2024
Bundle Size
20.14 kB
Minified
5.93 kB
Minified + Gzipped
Sponsor this package
Package Meta Information
Latest Version
2.1.0
Package Id
micromark-extension-mdx@2.1.0
Unpacked Size
12.00 kB
Size
4.14 kB
File Count
5
NPM Version
10.1.0
Node Version
20.8.1
Published on
Oct 19, 2023
Total Downloads
Cumulative downloads
Total Downloads
14,453,600
Last Day
-1.5%
2,636
Compared to previous day
Last Week
-8.6%
14,978
Compared to previous week
Last Month
23.2%
65,822
Compared to previous month
Last Year
-37.3%
946,903
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
micromark-extension-mdx
micromark extensions to support MDX, unaware of JavaScript.
Contents
- What is this?
- When to use this
- Install
- Use
- API
- Authoring
- Syntax
- Errors
- Types
- Compatibility
- Security
- Related
- Contribute
- License
What is this?
This package contains an extension that adds support for the syntax enabled
by MDX to micromark
.
This extension is used inside MDX.
It supports expressions, JSX, and turns some markdown features off.
It is not aware of the syntax of JavaScript inside expressions and does not
support export/imports.
When to use this
You can use this extension when you are working with micromark
.
This project is useful when you want to support MDX, unaware of JavaScript, for
example because expressions can include Rust or variables or whatnot.
If you want to be aware of JavaScript, use
micromark-extension-mdxjs
.
Alternatively, you can also use the underlying syntax extensions separately:
micromark-extension-mdx-expression
— support MDX expressionsmicromark-extension-mdx-jsx
— support MDX JSXmicromark-extension-mdx-md
— turn some CommonMark features off
When you need a syntax tree, combine this package with
mdast-util-mdx
.
All these packages are used in remark-mdx
, which focusses on
making it easier to transform content by abstracting these internals away.
Install
This package is ESM only. In Node.js (version 16+), install with npm:
1npm install micromark-extension-mdx
In Deno with esm.sh
:
1import {mdx} from 'https://esm.sh/micromark-extension-mdx@2'
In browsers with esm.sh
:
1<script type="module"> 2 import {mdx} from 'https://esm.sh/micromark-extension-mdx@2?bundle' 3</script>
Use
1import {micromark} from 'micromark' 2import {mdx} from 'micromark-extension-mdx' 3 4const output = micromark('a <b /> c {1 + 1} d', {extensions: [mdx()]}) 5 6console.log(output)
Yields:
1<p>a c d</p>
…which is useless: go to a syntax tree with
mdast-util-from-markdown
and
mdast-util-mdx
instead.
API
This package exports the identifier mdx
.
There is no default export.
The separate extensions support the development
condition.
Run node --conditions development module.js
to get instrumented dev code.
Without this condition, production code is loaded.
mdx()
Create an extension for micromark
to enable MDX syntax, unaware of JavaScript.
Returns
Extension for micromark
that can be passed in extensions
to enable MDX
syntax, unaware of JavaScript (Extension
).
Authoring
For recommendations on how to author MDX, see each corresponding readme:
Syntax
For info on the syntax of these features, see each corresponding readme:
- expressions
- JSX
- CommonMark features not in MDX: n/a
Errors
For info on what errors are thrown, see each corresponding readme:
- expressions
- JSX
- CommonMark features not in MDX: n/a
Types
This package is fully typed with TypeScript. It exports no additional types.
Compatibility
Projects maintained by the unified collective are compatible with maintained versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
micromark-extension-mdx@^2
, compatible with Node.js 16.
This package works with micromark
version 3
and later.
Security
This package is safe.
Related
micromark-extension-mdxjs
— support MDX aware of JSmdast-util-mdx
— support MDX in mdastremark-mdx
— support MDX syntax in remark
Contribute
See contributing.md
in micromark/.github
for ways to get
started.
See support.md
for ways to get help.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
License

No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: license:0
- Info: FSF or OSI recognized license: MIT License: license:0
Reason
0 existing vulnerabilities detected
Reason
security policy file detected
Details
- Info: security policy file detected: github.com/micromark/.github/security.md:1
- Info: Found linked content: github.com/micromark/.github/security.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/micromark/.github/security.md:1
- Info: Found text in security policy: github.com/micromark/.github/security.md:1
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/bb.yml:1
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/bb.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/micromark/micromark-extension-mdx/bb.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/micromark/micromark-extension-mdx/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/micromark/micromark-extension-mdx/main.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/micromark/micromark-extension-mdx/main.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/main.yml:15
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 third-party GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Score
4.1
/10
Last Scanned on 2025-02-17
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to micromark-extension-mdx
micromark-extension-mdx-jsx
micromark extension to support MDX or MDX.js JSX
micromark-extension-mdx-expression
micromark extension to support MDX or MDX JS expressions
micromark-extension-mdx-md
micromark extension to turn some markdown features off for MDX
micromark-extension-mdxjs
micromark extension to support MDX.js