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

rehype-gfm-alert

v0.1.0

Published

A rehype plugin to use GFM style alert.

Readme

rehype-gfm-alert

A rehype plugin to use GFM style alert.

Install

npm i rehype-gfm-alert rehype-raw

⚠️ rehype-raw is required to convert icon to HTML.

Use

For example:

import rehypeStringify from 'rehype-stringify';
import remarkParse from 'remark-parse';
import remarkRehype from 'remark-rehype';
import rehypeGFMAlert from 'rehype-gfm-alert';
import rehypeRaw from 'rehype-raw';
import { unified } from 'unified';

const process = (markdown: string): string => {
  const file = unified()
    .use(remarkParse)
    .use(remarkRehype)
    .use(rehypeGFMAlert)
    .use(rehypeRaw)
    .use(rehypeStringify)
    .processSync(markdown);

  return String(file).trim();
};

Simply

> [!NOTE]
> Highlights information that users should take into account, even when skimming.

> [!TIP]
> Optional information to help a user be more successful.

> [!IMPORTANT]
> Crucial information necessary for users to succeed.

> [!WARNING]
> Critical content demanding immediate user attention due to potential risks.

> [!CAUTION]
> Negative potential consequences of an action.

With Title

> [!CAUTION] This is Danger!
> Negative potential consequences of an action.

Config

unified().use(remarkQuoteCite[, options])
type AlertTypes = "note" | "tip" | "important" | "warning" | "caution";
type Options = {
  tagName?: string;
  alertClasses?: Record<AlertTypes, string[]>;
  icons?: Record<AlertTypes, string>;
  iconClasses?: Record<AlertTypes, string[]>;
  labels?: Record<AlertTypes, string>;
  labelClasses?: Record<AlertTypes, string[]>;
};

tagName

HTML tag name for alert block.

Default: aside

alertClasses

Arrays of HTML class name for each type of alert block.

Default:

{
  note:      ['alert', 'alert-note'],
  tip:       ['alert', 'alert-tip'],
  important: ['alert', 'alert-important'],
  warning:   ['alert', 'alert-warning'],
  caution:   ['alert', 'alert-caution'],
}

icons

Icon for each type of alert. You can use SVG (<svg>...</svg>)

default:

{
  note:      '📢',
  tip:       '💡',
  important: '💬',
  warning:   '⚠️',
  caution:   '⛔️',
}

⚠️ Icons are processed as raw HTML string, thus rehype-raw is required.

iconClasses

Arrays of HTML class name for each icon.

Defaults:

{
  note:      ['alert-icon'],
  tip:       ['alert-icon'],
  important: ['alert-icon'],
  warning:   ['alert-icon'],
  caution:   ['alert-icon'],
}

labels

Fallback labels for each type of alert. These labels are overwritten with individually specified titles (See 'With Title' above).

Default:

{
  note:      'Note: ',
  tip:       'Tip: ',
  important: 'Important: ',
  warning:   'Warning: ',
  caution:   'Caution: ',
}

labelClasses

Arrays of HTML class name for labels.

Default:

{
  note:      ['alert-label'],
  tip:       ['alert-label'],
  important: ['alert-label'],
  warning:   ['alert-label'],
  caution:   ['alert-label'],
}