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

github-markdown-editor

v1.0.3

Published

A modern GitHub-like Markdown editor built with CodeMirror 6

Readme

GitHub Markdown Editor

A modern, feature-rich Markdown editor built with CodeMirror 6, React, and TypeScript. Inspired by GitHub's editor with full GitHub Flavored Markdown (GFM) support.

✨ Features

  • 🎨 GitHub-inspired UI - Clean, professional interface matching GitHub's design
  • CodeMirror 6 - Powerful, extensible editor with syntax highlighting
  • 📝 GitHub Flavored Markdown - Full GFM support including tables, task lists, and strikethrough
  • 👁️ Live Preview - Toggle between edit and preview modes
  • 🎯 Custom Toolbar - Quick access to common markdown formatting
  • 📁 Import/Export - Import and export .md files
  • 🌓 Light/Dark Theme - Built-in theme support
  • 📊 Word Count - Real-time character and word counting
  • ⌨️ Keyboard Shortcuts - Standard text editor shortcuts
  • 🔧 TypeScript - Full type safety and IntelliSense support

📦 Installation

npm install github-markdown-editor
# or
yarn add github-markdown-editor
# or
pnpm add github-markdown-editor

🚀 Quick Start

import { MarkdownEditor } from 'github-markdown-editor';
import 'github-markdown-editor/dist/style.css';

function App() {
  const handleChange = (value: string) => {
    console.log('Markdown content:', value);
  };

  return (
    <MarkdownEditor
      initialValue="# Hello World"
      onChange={handleChange}
      height="600px"
    />
  );
}

📖 API Reference

MarkdownEditor Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | initialValue | string | '' | Initial markdown content | | onChange | (value: string) => void | - | Callback fired when content changes | | height | string | '600px' | Height of the editor | | theme | 'light' \| 'dark' | 'light' | Editor theme | | showToolbar | boolean | true | Show/hide the toolbar | | showPreview | boolean | false | Initial preview state |

Utility Functions

import {
  convertMarkdownToHtml,
  exportToMarkdown,
  exportToHtml,
  extractFrontmatter
} from 'github-markdown-editor';

// Convert markdown to HTML
const html = await convertMarkdownToHtml('# Hello');

// Export markdown
exportToMarkdown(content, 'document.md');

// Export as HTML
exportToHtml(htmlContent, 'document.html');

// Extract frontmatter
const { frontmatter, content } = extractFrontmatter(markdown);

🎨 Customization

Custom Styling

You can override the default styles by targeting the CSS classes:

.markdown-editor {
  /* Your custom styles */
}

.toolbar {
  /* Custom toolbar styles */
}

.preview-wrapper {
  /* Custom preview styles */
}

Dark Theme

<MarkdownEditor theme="dark" />

🔧 Advanced Usage

Controlled Component

import { useState } from 'react';
import { MarkdownEditor } from 'github-markdown-editor';

function ControlledEditor() {
  const [markdown, setMarkdown] = useState('# Hello');

  return (
    <div>
      <MarkdownEditor
        initialValue={markdown}
        onChange={setMarkdown}
      />
      <button onClick={() => console.log(markdown)}>
        Get Content
      </button>
    </div>
  );
}

With Custom Height and No Toolbar

<MarkdownEditor
  height="100vh"
  showToolbar={false}
  showPreview={true}
/>

🎯 Supported Markdown Features

  • Headers - # H1 through ###### H6
  • Emphasis - *italic* and **bold**
  • Lists - Ordered and unordered
  • Links - [text](url)
  • Images - ![alt](url)
  • Code - Inline and fenced code blocks with syntax highlighting
  • Tables - GitHub-style tables
  • Task Lists - - [ ] and - [x]
  • Blockquotes - > quote
  • Strikethrough - ~~text~~
  • Horizontal Rules - ---
  • Autolinks - Automatic URL linking

🛠️ Development

# Clone the repository
git clone https://github.com/justq-me/gh-markdown-editor.git

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

# Run tests
npm test

📝 License

MIT © [Your Name]

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

🐛 Issues

If you find a bug or have a feature request, please create an issue on GitHub.

🙏 Acknowledgments

  • CodeMirror 6 - The powerful editor foundation
  • remark - Markdown processing
  • GitHub - Design inspiration

📊 Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

🔗 Links


Made with ❤️ by JustQ