
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.
mdjsx-loader
Advanced tools
A markdown loader with embedded jsx
We wanted an expressive way to write markdown documentation for a react style-guide.
Add this loader to your preferred filetypes. We use the .md extension.
// In webpack.config.js
module.exports = {
/* Omitted */
module: {
loaders: [
{
test: /\.md$/,
loaders: ['babel', 'mdjsx']
}
]
}
}
Notice the dependency on the
babelloader. That is because themdjsxloader creates an es6 module with jsx syntax.
mdjsx-loaderexports two values.
import Component, { attributes } from 'my-md-file.md';
Component // a react component which includes the compiled markdown and react components
attributes // the front-matter attributes from the markdown file
$importsspecial front-matter attributes allows you to import any javascript module
---
$imports:
'{ A, B }': 'module1'
'* as C': 'module2'
D: 'module3'
---
### My title
Use imported react components
<A>
<D />
<C.X>
Hello there
</C.X>
</A>
$attributesspecial variable gives you access to all front-matter attributes (except for the $imports)
---
propA: 'Hello World'
---
### My title
Use front-matter attributes
<span>{$attributes.propA}</span>
$propsspecial variable gives you access to the component props.
in md file
# Hello world
<span>{$props.content}</span>
consumer
import Component from 'my-md-file.md';
import ReactDom from 'react-dom';
ReactDom.render(
document.getElementById('root'),
<Component content="This will be interpolated in span" />
)
FAQs
> A markdown loader with embedded jsx
The npm package mdjsx-loader receives a total of 5 weekly downloads. As such, mdjsx-loader popularity was classified as not popular.
We found that mdjsx-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.