micromark extension to support MDX.js
Installations
npm install micromark-extension-mdxjs
Developer Guide
Typescript
Yes
Module System
ESM
Node Version
20.8.1
NPM Version
10.1.0
Score
98.1
Supply Chain
99.2
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
153,869,492
Last Day
344,299
Last Week
1,557,123
Last Month
7,635,972
Last Year
77,054,183
GitHub Statistics
MIT License
8 Stars
46 Commits
6 Watchers
1 Branches
11 Contributors
Updated on Sep 29, 2024
Sponsor this package
Package Meta Information
Latest Version
3.0.0
Package Id
micromark-extension-mdxjs@3.0.0
Unpacked Size
13.66 kB
Size
4.51 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
153,869,492
Last Day
-4.2%
344,299
Compared to previous day
Last Week
-18.6%
1,557,123
Compared to previous week
Last Month
44.5%
7,635,972
Compared to previous month
Last Year
72.4%
77,054,183
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
micromark-extension-mdxjs
micromark extensions to support MDX.
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 export/imports, expressions, JSX, and turns some markdown features
off.
When to use this
This project is useful when you want to support MDX.
You can use this extension when you are working with micromark
.
This package is aware of JavaScript syntax.
If you want to be unaware of JavaScript, for example because expressions can
include Rust or variables or whatnot, use
micromark-extension-mdx
.
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 offmicromark-extension-mdxjs-esm
— support MDX export/imports
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-mdxjs
In Deno with esm.sh
:
1import {mdxjs} from 'https://esm.sh/micromark-extension-mdxjs@2'
In browsers with esm.sh
:
1<script type="module"> 2 import {mdxjs} from 'https://esm.sh/micromark-extension-mdxjs@2?bundle' 3</script>
Use
1import {micromark} from 'micromark' 2import {mdxjs} from 'micromark-extension-mdxjs' 3 4const output = micromark('import a from "b"\n\na <b /> c {1 + 1} d', { 5 extensions: [mdxjs()] 6}) 7 8console.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 mdxjs
.
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.
mdxjs(options?)
Create an extension for micromark
to enable MDX syntax.
Parameters
options
(Options
, optional) — configuration; passed to all extensions
Returns
Extension for micromark
that can be passed in extensions
to enable MDX
syntax (Extension
).
Options
Configuration (TypeScript type).
Type
1export type {Options} from 'micromark-extension-mdx-expression'
See Options
.
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
- ESM
- CommonMark features not in MDX: n/a
Errors
For info on what errors are thrown, see each corresponding readme:
- expressions
- JSX
- ESM
- CommonMark features not in MDX: n/a
Types
This package is fully typed with TypeScript.
It exports the additional type Options
.
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-mdxjs@^2
, compatible with Node.js 16.
This package works with micromark
version 3
and later.
Security
This package is safe.
Related
micromark-extension-mdx
— support MDX unaware 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
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: license:0
- Info: FSF or OSI recognized license: MIT License: license:0
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
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-mdxjs/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-mdxjs/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-mdxjs/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-mdxjs/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 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
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-10
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-mdxjs
micromark-extension-mdxjs-esm
micromark extension to support MDX JS import/exports
micromark-extension-mdx-jsx
micromark extension to support MDX or MDX.js JSX
micromark-extension-mdx-md
micromark extension to turn some markdown features off for MDX
micromark-extension-mdx-expression
micromark extension to support MDX or MDX JS expressions