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

emdp

v1.0.0

Published

A CommonMark-compliant Markdown parser with optional GFM support

Readme

CommonMark Parser (with GFM support)

A CommonMark-compliant Markdown parser with an optional GitHub Flavored Markdown (GFM) mode, plus a small set of cmark-gfm compatible extensions.

Features

  • CommonMark parser with block and inline support
  • GFM mode (tables, strikethrough, task lists, extended autolinks, tag filtering)
  • Footnotes (GFM-style)
  • HTML rendering with safe-mode controls
  • CLI for pipeline usage
  • TypeScript types with dual ESM/CJS exports

Installation

npm install emdp

Quick Start

CommonMark

import { markdown } from 'emdp';

const html = markdown('# Hello *world*');
console.log(html);

CommonJS

const { markdown } = require('emdp');

const html = markdown('# Hello *world*');
console.log(html);

GFM

import { gfm } from 'emdp/gfm';

const html = gfm('- [x] done\n- [ ] todo');
console.log(html);

Usage Examples

Render with Options

import { gfm } from 'emdp/gfm';

const html = gfm(source, {
  safe: true,
  smart: true,
  tablePreferStyleAttributes: true,
  fullInfoString: true,
  tagfilter: true,
  extensions: ['table', 'strikethrough', 'autolink', 'tagfilter', 'tasklist', 'footnotes'],
});

Parse and Render Separately

import { parse, render } from 'emdp';
import { parse as gfmParse, render as gfmRender } from 'emdp/gfm';

const doc = parse(source);
const html = render(doc);

const gfmDoc = gfmParse(source);
const gfmHtml = gfmRender(gfmDoc, { smart: true });

CLI

# CommonMark
mdparse < README.md

# GFM
mdparse --gfm < README.md

CLI Flags

  • --gfm - enable GFM parsing
  • -e <extension> - enable specific extensions (for test compatibility)
  • --smart - smart punctuation
  • --table-prefer-style-attributes - use style attributes for table alignment
  • --full-info-string - render full info string as data-meta on code blocks
  • --unsafe - ignored (compatibility flag)

API Reference

CommonMark

  • markdown(input, options) - parse + render
  • parse(input, options) - parse into AST
  • render(document, options) - render AST to HTML

GFM

  • gfm(input, options) - parse + render (GFM)
  • parse(input, options) - parse into AST (GFM)
  • render(document, options) - render AST to HTML (GFM)

Render Options

  • safe - omit raw HTML output
  • softbreak - string used for soft line breaks (default: \n)
  • smart - enable smart punctuation
  • tablePreferStyleAttributes - use style attributes for table alignment
  • fullInfoString - include full info string as data-meta on code blocks
  • tagfilter - escape disallowed raw HTML tags (GFM tag filter)
  • extensions - list of GFM extensions to enable (defaults to all supported)

License

MIT License