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

nizel-plugin-badge

v0.1.0

Published

Inline badge and status label plugin for Nizel.

Readme

nizel-plugin-badge

Inline badge and status label syntax for Nizel.

Installation

npm install nizel-plugin-badge

Basic Usage

import { useNizel } from 'nizel';
import { badgePlugin } from 'nizel-plugin-badge';
import 'nizel-plugin-badge/style.css';

const nizel = useNizel({
  plugins: [
    badgePlugin({
      defaultTone: 'neutral',
    }),
  ],
});

Syntax

:badge(beta)
:badge(v1.2.0)
:badge(deprecated, tone="warning")
:badge(done, tone="success", title="This task is complete")
:badge("Breaking Change", tone="danger")

The first positional argument is the label. Use quotes when the label contains a comma or closing parenthesis.

Options

badgePlugin({
  className: 'nizel-badge',
  defaultTone: 'neutral',
  allowedTones: ['neutral', 'info', 'success', 'warning', 'danger', 'purple', 'blue', 'green', 'yellow', 'red'],
  collectMetadata: true,
  aliases: {
    beta: { label: 'Beta', tone: 'info' },
    deprecated: { label: 'Deprecated', tone: 'warning' },
    done: { label: 'Done', tone: 'success' },
  },
});

Supported Markdown options are tone, title, and className.

Unknown or disallowed tones fall back to the configured defaultTone, or neutral if the configured default is not allowed.

Output

:badge(deprecated, tone="warning")
<span class="nizel-badge" data-tone="warning">deprecated</span>

All label, title, class, and tone values are escaped before rendering.

Aliases

badgePlugin({
  aliases: {
    beta: { label: 'Beta', tone: 'info' },
    deprecated: { label: 'Deprecated', tone: 'warning' },
    done: { label: 'Done', tone: 'success' },
  },
});

Explicit Markdown options override alias defaults.

Styling

Import the default stylesheet when you want the minimal bundled badge styles:

import 'nizel-plugin-badge/style.css';

The stylesheet only defines the base pill shape and tone colors. Host apps can override all selectors.

Metadata

When collectMetadata is enabled, the plugin adds badge usage to result.meta.badge.badges.

{
  badge: {
    badges: [
      {
        label: 'Deprecated',
        tone: 'warning',
        original: 'deprecated'
      }
    ]
  }
}

Security

The plugin escapes badge labels, titles, custom classes, and data-tone values. Unknown tones do not pass through to HTML; they fall back to defaultTone or neutral.

Parser Behavior

The plugin transforms inline :badge(...) expressions in normal text. It does not transform fenced code, inline code, raw HTML blocks, or escaped syntax such as \:badge(beta).

Integration Example

const result = await nizel('# Release :badge(beta, tone="info")');

console.log(result.html);
console.log(result.meta.badge);