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

@decbr/fgmd

v0.4.0

Published

a f***ing good markdown parser.

Readme

fgmd

npm tests licence docs site

A f***ing good Markdown parser.

View the site at fgmd.dev, view the site's source at /site

  • Standard. Passes all 652 CommonMark 0.31.2 spec examples and all 24 GFM extension examples.
  • Safe by default. Raw HTML is shown as text unless you opt in, and only http, https, mailto, tel and relative URLs get through. Hostile input can't hang or crash it.
  • Extensible. Eight built-in plugins, plus a plugin API for new inline syntax, block syntax and tree transforms.
  • Zero runtime dependencies. The library uses no Node APIs, so it runs in Node, Deno, Workers and browsers. It has a first-class Svelte 5 component and a CLI for other languages.

Install

npm install @decbr/fgmd

Without Svelte

markdown() turns a string into HTML:

import { markdown, callouts, math } from '@decbr/fgmd';

markdown('# Hello *world*');
// '<h1>Hello <em>world</em></h1>\n'

markdown(source, {
  plugins: [callouts(), math()],
  headingIds: true,
  classes: { p: 'mb-4', a: 'text-accent' },
  linkAttrs: (url) => (url.startsWith('/') ? null : { target: '_blank', rel: 'noreferrer' })
});

For content anyone can write, such as comments, html: 'sanitize' lets through a safe, GitHub-like subset of HTML. markdownInline() renders a single line without the wrapping <p>.

A page's metadata can live in the file, in a --- block above the copy. frontmatter() splits it off:

import { frontmatter } from '@decbr/fgmd';

const { data, body } = frontmatter(source);
// data: { "title": "Page Title", "blurb": "Page Blurb" }, body: the Markdown after the block

markdown(source, { frontmatter: true }) renders the same file with the block left out. See Syntax.

Using React? See React.

From PHP, Python, Ruby or Go, use the CLI:

cat post.md | fgmd --plugins callouts,typography > post.html

With Svelte

Svelte 5 is an optional peer dependency. The <Markdown> component takes the same options as markdown(), and it renders real elements with no {@html}:

<script>
  import { InlineMarkdown, Markdown } from '@decbr/fgmd/svelte';
  import { callouts } from '@decbr/fgmd';
  import source from './privacy.md?raw';
</script>

<Markdown {source} plugins={[callouts()]} classes={{ h2: 'text-2xl mt-10', p: 'mb-4 text-muted' }} />

<!-- short copy: inline markdown, no <p>. leaves the block parser out of the bundle -->
<p class="lede"><InlineMarkdown source={game.blurb} /></p>

With Vite, a .md file can be imported as a string:

<script>
    import Prose from '$lib/Prose.svelte';
    import privacy from './privacy.md?raw';
</script>

<Prose source={privacy} />

You can also draw any node your own way with a snippet. For that, and more, see Svelte.

Documentation

  • Syntax: what's supported, and what changes when coming from a regex-based parser
  • Options: every parsing and rendering option
  • Plugins: the built-ins, and writing your own
  • Safety: what the defaults protect against, and how html: 'sanitize' works
  • Svelte: the component, snippets and props
  • React: rendering in React and Next.js
  • CLI: using fgmd from other languages (PHP, etc.)
  • The tree: parsing to a tree, walking it and rendering it
  • Recipes: option sets for common sites
  • Development: tests, spec reports and regenerating data
  • Breaking changes: what to change in your code when upgrading between versions

License

MIT
decbr [email protected]