npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@imminent/mdx-render

v0.1.3

Published

Convert .mdx files to standalone HTML with embedded React components

Downloads

21

Readme

mdx-render

Convert .mdx files to standalone HTML with embedded React components.

The output is a single self-contained .html file — no server required. Open it directly in a browser.

Install

npm install -g @imminent/mdx-render

Usage

# Basic conversion — outputs my-doc.html
mdx-render my-doc.mdx

# Specify output file
mdx-render my-doc.mdx -o dist/index.html

# Add a custom page title
mdx-render my-doc.mdx --title "My Document"

# Inline a CSS file
mdx-render my-doc.mdx --css styles.css

# Use a components config (see below)
mdx-render my-doc.mdx --config mdx-render.config.js

Options

| Option | Description | |---|---| | <input> | Path to the .mdx file to convert | | -o, --output <file> | Output HTML file path (default: <input-name>.html) | | -c, --config <file> | Path to components config (auto-discovers mdx-render.config.js) | | --title <title> | HTML <title> tag content (default: input filename) | | --css <file> | Path to a CSS file to inline into the output HTML | | -V, --version | Print version number | | -h, --help | Print help |

Use with npx (no install required)

npx mdx-render my-doc.mdx

Custom Components

MDX files can use custom React components. To make them available during bundling, create a config file:

// mdx-render.config.js
import { MyChart } from './components/MyChart.jsx'
import { CodeBlock } from './components/CodeBlock.jsx'

export const components = {
  MyChart,
  CodeBlock,
}

Then run:

mdx-render my-doc.mdx --config mdx-render.config.js

Or place mdx-render.config.js in the same directory where you run the command — it will be picked up automatically.

Inside your .mdx file, use components by name:

# Hello

<MyChart data={[1, 2, 3]} />

Some text with a <CodeBlock lang="js">console.log('hi')</CodeBlock>

Note: The config file and its imports are bundled using esbuild. Your components' own dependencies must be installed in a node_modules directory reachable from the config file. React itself is provided by mdx-render — you do not need React in your project.

How it works

  1. The .mdx file is compiled to a JavaScript ES module using @mdx-js/mdx.
  2. The compiled module is bundled with React (included), react-dom/client, and any custom components using esbuild into a single minified IIFE script.
  3. The script is embedded in a minimal HTML file alongside a <div id="root">.
  4. When the HTML file is opened in a browser, React mounts and renders the MDX content.

License

MIT