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

mdx-hybrid

v0.0.5

Published

Hybrid MDX compiler combining Rust speed with JavaScript compatibility

Readme

mdx-hybrid

A hybrid MDX compiler that combines Rust's compilation speed with JavaScript's plugin compatibility, providing 5-20x build time improvements for projects without plugins.

🎉 Status

v0.0.1 - Fully functional with Rust engine delivering impressive performance gains!

Features

  • 🚀 Blazing Fast: 5-20x faster compilation with Rust engine (benchmarked)
  • 🔧 Full Compatibility: Falls back to JS engine for plugin support
  • 🎯 Smart Selection: Automatically chooses the best engine
  • 📦 Drop-in Replacement: Works with existing MDX setups
  • 🔌 Framework Integrations: Vite, Astro, and more

Performance

Real-world benchmark results:

  • Small files (< 1KB): ~20x faster with Rust
  • Medium files (2-3KB): ~7x faster with Rust
  • Large files (> 10KB): ~5x faster with Rust

Installation

npm install @jp-knj/mdx-hybrid-core
# or
pnpm add @jp-knj/mdx-hybrid-core
# or
yarn add @jp-knj/mdx-hybrid-core

Usage

Basic Usage

import { compile } from '@jp-knj/mdx-hybrid-core'

const result = await compile('# Hello MDX!')
console.log(result.code)

With Options

import { compile } from '@jp-knj/mdx-hybrid-core'

const result = await compile(mdxContent, {
  // Force specific engine
  engine: 'rust', // 'js' | 'rust' | 'auto' (default)
  
  // Standard MDX options
  development: true,
  jsx: true,
  jsxRuntime: 'automatic',
  jsxImportSource: 'react',
})

Vite Integration

// vite.config.js
import { mdxHybrid } from '@jp-knj/mdx-hybrid-vite'

export default {
  plugins: [mdxHybrid()]
}

Astro Integration

// astro.config.mjs
import { mdxHybrid } from '@jp-knj/mdx-hybrid-astro'

export default {
  integrations: [mdxHybrid()]
}

Engine Selection

The compiler automatically selects the appropriate engine:

  1. Explicit: Use the engine specified in options (engine: 'rust' or engine: 'js')
  2. Plugins: Automatically use JS engine if remark/rehype plugins are present
  3. Performance: Use Rust engine by default for maximum speed
  4. Fallback: Gracefully fall back to available engine if one fails

When Each Engine is Used

  • Rust Engine ⚡️

    • No plugins required
    • Maximum compilation speed needed
    • Production builds without customization
  • JS Engine 🔌

    • Remark/Rehype plugins needed
    • Custom transformations required
    • Development with hot reload (still fast!)

Compatibility

| Feature | JS Engine | Rust Engine | |---------|-----------|-------------| | Basic MDX | ✅ | ✅ | | remarkPlugins | ✅ | ❌ | | rehypePlugins | ✅ | ❌ | | JSX Runtime | ✅ | ✅ | | Development Mode | ✅ | ✅ | | Source Maps | ✅ | ⚠️ Basic |

Binary Distribution

The Rust engine uses platform-specific native binaries for optimal performance. These binaries are automatically downloaded during installation based on your platform.

Supported Platforms

| Platform | Architecture | Package | |----------|-------------|---------| | macOS | x64 (Intel) | @jp-knj/mdx-hybrid-engine-rust-darwin-x64 | | macOS | ARM64 (Apple Silicon) | @jp-knj/mdx-hybrid-engine-rust-darwin-arm64 | | Windows | x64 | @jp-knj/mdx-hybrid-engine-rust-win32-x64-msvc | | Linux | x64 (glibc) | @jp-knj/mdx-hybrid-engine-rust-linux-x64-gnu | | Linux | x64 (musl) | @jp-knj/mdx-hybrid-engine-rust-linux-x64-musl |

The correct binary is automatically selected during installation via npm's optionalDependencies.

Development

# Install dependencies
pnpm install

# Build all packages
pnpm build

# Run tests
pnpm test

# Run benchmarks
pnpm bench

# Start development mode
pnpm dev

Publishing Binaries

The project uses GitHub Actions to automatically build and publish platform-specific binaries:

# Build Rust engine for current platform
pnpm --filter @jp-knj/mdx-hybrid-engine-rust build

# Manually publish binaries (requires npm access)
pnpm --filter @jp-knj/mdx-hybrid-engine-rust publish:binaries

# Dry run to test publishing
pnpm --filter @jp-knj/mdx-hybrid-engine-rust publish:binaries -- --dry-run

Binary publishing is automated via GitHub Actions when releasing a new version.

License

MIT