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

@powerduck/md-editor

v0.11.8

Published

High-performance embeddable Markdown editor: KaTeX math, Markmap mindmaps, highlight.js code blocks with copy button, github-markdown-css preview, admonition blocks, rich toolbar with image/video/YouTube/table popups, keyboard shortcuts, configurable tool

Readme

@powerduck/md-editor

npm version license downloads

High-performance embeddable Markdown editor with syntax highlighting, math formulas, mindmaps, @mentions, document link cards, and incremental rendering. Built on CodeMirror 6 with a React wrapper.


Powerduck is an open-source developer tooling platform for teams building modern API workflows.

  • CodeMirror 6 Core — Incremental rendering, virtual scrolling, and 60fps editing for large documents
  • KaTeX Math — Render LaTeX math formulas inline and in display blocks
  • Markmap Mindmaps — Visualize markdown outlines as interactive mindmaps
  • highlight.js Code Blocks — Syntax highlighting for 190+ programming languages
  • @mentions — Type @ to search and mention users with avatars and descriptions
  • Document Link Cards — Type / to insert rich doc-link preview cards with thumbnails
  • Admonition Blocks — :::tip, :::warning, :::note, and more
  • Simple & Complex Modes — Lightweight mode for comments, full-featured mode for docs
  • Light & Dark Themes — Built-in themes with CSS variable customization

Quick Start

Install

npm install @powerduck/md-editor

React Component

import { useRef, useState } from "react";
import {
  MarkdownEditorReact,
  type MarkdownEditorHandle,
} from "@powerduck/md-editor/react";
import "@powerduck/md-editor/dist/style.css";

function App() {
  const [value, setValue] = useState("# Hello\n\nStart typing...");
  const editorRef = useRef<MarkdownEditorHandle>(null);

  return (
    <div style={{ height: "600px" }}>
      <MarkdownEditorReact
        ref={editorRef}
        value={value}
        onChange={setValue}
        mode="complex"
        theme="light"
      />
      <button onClick={() => console.log(editorRef.current?.getHtml())}>
        Get HTML
      </button>
    </div>
  );
}

Vanilla JS

import { MarkdownEditor } from "@powerduck/md-editor";
import "@powerduck/md-editor/dist/style.css";

const editor = new MarkdownEditor("#editor", {
  value: "# Hello\n\nStart typing...",
  mode: "complex",
  theme: "light",
  onChange: (value) => console.log(value.length, "chars"),
});

const html = editor.getHtml();

Links


Features

  • CodeMirror 6 core — incremental rendering, virtual scrolling, and 60fps editing for large documents
  • KaTeX math — render LaTeX math formulas inline and in display blocks
  • Markmap mindmaps — visualize markdown outlines as interactive mindmaps
  • highlight.js code blocks — syntax highlighting for 190+ programming languages
  • @mentions — type @ to search and mention users with avatars and descriptions
  • Document link cards — type / to insert rich doc-link preview cards with thumbnails
  • Admonition blocks — :::tip, :::warning, :::note, and more
  • Simple & complex modes — lightweight mode for comments, full-featured mode for docs
  • Light & dark themes — built-in themes with CSS variable customization
  • Image upload hooks — custom upload handlers with paste and drag-and-drop support
  • Toolbar & slash commands — rich formatting toolbar and / command palette
  • Dual ESM/CJS builds — works with import and require, with bundled TypeScript declarations

@mention Integration

import { MarkdownEditor, type MentionItem } from "@powerduck/md-editor";

const USERS: MentionItem[] = [
  {
    id: "1",
    label: "Alice",
    avatar: "https://example.com/a.png",
    description: "[email protected]",
  },
  { id: "2", label: "Bob", description: "[email protected]" },
];

new MarkdownEditor("#editor", {
  mode: "complex",
  mention: {
    onMentionSearch: async (query) =>
      USERS.filter((u) => u.label.toLowerCase().includes(query.toLowerCase())),
    onMentionSelect: (item) => `[@${item.label}](mention:${item.id})`,
    minChars: 0,
    maxItems: 8,
  },
});

Document Link Card

import { MarkdownEditor, type DocItem } from "@powerduck/md-editor";

const DOCS: DocItem[] = [
  {
    id: "1",
    title: "Getting Started",
    url: "https://docs.example.com/getting-started",
    thumbnail: "https://example.com/thumb.jpg",
    description: "Quick start tutorial",
  },
];

new MarkdownEditor("#editor", {
  mode: "complex",
  docLink: {
    onDocSearch: async (query) =>
      DOCS.filter((d) => d.title.toLowerCase().includes(query.toLowerCase())),
    insertStyle: "card",
    minChars: 0,
    maxItems: 6,
  },
});

API Reference

React Props

| Prop | Type | Default | Description | | ---------------- | ------------------------- | ----------- | --------------------------------------- | | value | string | - | Markdown content (controlled) | | defaultValue | string | - | Initial markdown content (uncontrolled) | | onChange | (value: string) => void | - | Content change callback | | mode | "simple" \| "complex" | "complex" | Editor mode | | theme | "light" \| "dark" | "light" | Color theme | | math | boolean | true | Enable KaTeX math rendering | | mindmap | boolean | true | Enable Markmap mindmaps | | codeHighlight | boolean | true | Enable highlight.js code blocks | | tips | boolean | true | Enable admonition blocks | | preview | boolean | true | Show preview pane | | autoPreview | boolean | true | Auto-update preview | | renderDebounce | number | 200 | Preview render debounce in ms | | mention | MentionOptions | - | @mention configuration | | docLink | DocLinkOptions | - | Document link card configuration |

Imperative Handle (React)

interface MarkdownEditorHandle {
  getValue(): string;
  setValue(value: string): void;
  getHtml(): string;
  focus(): void;
  setMode(mode: EditorMode): void;
  setTheme(theme: EditorTheme): void;
  renderNow(): void;
}

MentionOptions

interface MentionOptions {
  onMentionSearch: (query: string) => MentionItem[] | Promise<MentionItem[]>;
  onMentionSelect?: (item: MentionItem) => string;
  minChars?: number;
  maxItems?: number;
  triggerChar?: string;
}

DocLinkOptions

interface DocLinkOptions {
  onDocSearch: (query: string) => DocItem[] | Promise<DocItem[]>;
  onFetchDocMeta?: (url: string) => Promise<DocMeta>;
  insertStyle?: "card" | "link" | "auto";
  minChars?: number;
  maxItems?: number;
  triggerChar?: string;
}

TypeScript Types

import type {
  MentionItem,
  DocItem,
  DocMeta,
  MentionOptions,
  DocLinkOptions,
} from "@powerduck/md-editor";
import type {
  MarkdownEditorHandle,
  MarkdownEditorProps,
} from "@powerduck/md-editor/react";

Browser Support

  • Chrome 90+
  • Firefox 88+
  • Safari 14+
  • Edge 90+

License

MIT © POWERDUCK LIMITED