Gathering detailed insights and metrics for @mdx-js/node-loader
Gathering detailed insights and metrics for @mdx-js/node-loader
npm install @mdx-js/node-loader
Typescript
Module System
Node Version
NPM Version
66.6
Supply Chain
97.7
Quality
81.4
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
64,252
Last Day
69
Last Week
368
Last Month
1,962
Last Year
34,667
MIT License
18,091 Stars
1,752 Commits
1,147 Forks
88 Watchers
6 Branches
190 Contributors
Updated on Feb 21, 2025
Latest Version
3.1.0
Package Id
@mdx-js/node-loader@3.1.0
Unpacked Size
14.24 kB
Size
5.62 kB
File Count
15
NPM Version
10.9.0
Node Version
23.0.0
Published on
Oct 18, 2024
Cumulative downloads
Total Downloads
Last Day
25.5%
69
Compared to previous day
Last Week
13.9%
368
Compared to previous week
Last Month
14.3%
1,962
Compared to previous month
Last Year
52.6%
34,667
Compared to previous year
4
@mdx-js/node-loader
Node.js hooks (also knows as loaders) for MDX.
This package contains Node.js hooks to add support for importing MDX files. Node Customization Hooks are currently a release candidate.
This integration is useful if you’re using Node and want to import MDX files from the file system.
If you’re using a bundler (webpack, Rollup, esbuild), or a site builder (Next.js) or build system (Vite) which comes with a bundler, you can instead another integration: see § Integrations.
This package is ESM only. In Node.js (version 16+), install with npm:
1npm install @mdx-js/node-loader
Say we have an MDX document, example.mdx
:
1export function Thing() { 2 return <>World!</> 3} 4 5# Hello, <Thing />
…and our module example.js
looks as follows:
1import {renderToStaticMarkup} from 'react-dom/server' 2import React from 'react' 3import Content from './example.mdx' 4 5console.log(renderToStaticMarkup(React.createElement(Content)))
…then running with:
1node --loader=@mdx-js/node-loader example.js
…yields:
1<h1>Hello, World!</h1>
Note: if you use Node 18 and lower, then you can ignore the following warning:
1(node:20718) ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any > time 2(Use `node --trace-warnings ...` to show where the warning was created)
Note: if you use Node 20 and higher, then you get the following warning:
1(node:20908) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use > `register()`: 2--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from > "node:url"; register("%40mdx-js/node-loader", pathToFileURL("./"));'
You can solve that by adding a
register.js
file:1import {register} from 'node:module' 2 3register('@mdx-js/node-loader', import.meta.url)
…and running
node --import ./register.js example.js
instead.
This package export the identifiers createLoader
and
load
.
There is no default export.
createLoader(options?)
Create Node.js hooks to handle markdown and MDX.
options
(Options
, optional)
— configurationNode.js hooks ({load}
).
load
Load file:
URLs to MD(X) files.
See load
in Node.js docs for more info.
Options
Configuration (TypeScript type).
Options are the same as CompileOptions
from @mdx-js/mdx
exception that the development
option is supported based on whether you
run Node with --conditions development
.
You cannot pass it manually.
This package is fully typed with TypeScript.
It exports the additional type Options
.
See § Types on our website for information.
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, @mdx-js/node-loader@^3
,
compatible with Node.js 16.
See § Security on our website for information.
See § Contribute on our website for ways to get started. See § Support 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.
No vulnerabilities found.
Reason
7 commit(s) and 11 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
1 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
Found 0/28 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
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 More