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

pretty-toc-alpha

v1.6.9

Published

A Table of Contents generation plugin for the Satteri markdown parser library. This package serves as a pre-release test for pretty-toc. Please install pretty-toc for the stable version.

Readme

CodeQL Advanced Coverage Verify and Release GitHub License GitHub repo size NPM Unpacked Size NPM Version NPM Downloads NPM Downloads

A Table of Contents generation plugin for the Satteri markdown parser library.

[!WARNING] This package serves as a pre-release test for pretty-toc. Please install pretty-toc for the stable version.

Install

// install with npm
npm install pretty-toc-alpha --save-dev

// install with pnpm
pnpm install pretty-toc-alpha --save-dev

// install with yarn
yarn add -D pretty-toc-alpha

// install with bun
bun add -D pretty-toc-alpha

// install with deno
deno add -D pretty-toc-alpha

Table of Contents

Example

import prettyToc from 'pretty-toc-alpha';

// Basic example
satteri({
  hastPlugins: [prettyToc({title: "Table of Contents", listStyle: "decimal"})]
})

// Full example
satteri({
  hastPlugins: [
    prettyToc({
      title: "Table of Contents",
      openedMarker: '🦋',
      closedMarker: '🐢',
      titleMarkerType: 'icon',
      titleMarkerCssSize: '1rem',
      listStyle: "image", // disc, circle, decimal, none... icon, image...
      icon: ["🐶", "🦁", "🐷", "🐸", "🐥", "🐞"], // or just a string, eg. "🐥"
      image: [
        "/svg/unjs--automd.svg",
        "/svg/unjs--hookable.svg",
        "/svg/unjs--knitwork.svg",
        "/svg/unjs--mongoz.svg",
        "/svg/unjs--ofetch.svg",
        "/svg/unjs--uncrypto.svg",
      ], // or just a string, eg. "/svg/unjs--automd.svg"
      liMarkerCssSize: "1rem",
      lightThemeHighlightColor: "oklch(0.75 0.1229 12.71)",
      darkThemeHighlightColor: "oklch(0.81 0.1004 305.04)",
      animation: {
        duration: '0.8s',
        timingFunction: 'ease-in-out'
      },
      class: {
        title: "",
        ul: "",
        li: "",
        a: "",
      },
      globalStyle: "",
      style: {
        title: "",
        ul: "",
        li: "",
        a: "",
      },
      locale: "zh-CN", // Note: The case of the locale variable should match the locale in your page URL.
      languageMap: {
        "de-DE": "Inhaltsverzeichnis",
        "el-GR": "Περιεχόμενα",
        "en-US": "Table of Contents",
        "es-ES": "Índice",
        "fr-FR": "Sommaire",
        "it-IT": "Indice",
        "ja-JP": "目次",
        "ko-KR": "목차",
        "ru-RU": "Оглавление",
        "th-TH": "สารบัญ",
        "tr-TR": "İçindekiler",
        "zh-CN": "目录",
        "zh-Hant": "目錄",
      },
    }),
  ],
}),

Screenshots

Options

| Property‌ | Type | Default Value | Preset Value | Description | | :----------------------- | :--------------------------------------------------------------------------- | :---------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------- | | title | string | Table of Contents | Table of Contents | - | | openedMarker | string or undefined | undefined | ▼ | Note: titleMarkerType must already be set. | | closedMarker | string or undefined | undefined | ▶︎ | Note: titleMarkerType must already be set. | | titleMarkerType | string or undefined | undefined | icon | Value can only be "icon" or "image". | | titleMarkerCssSize | string or undefined | undefined | fit-content | - | | listStyle | string or undefined | undefined | decimal | eg. disc, circle, decimal, none... or icon and image | | icon | string or string[] or undefined | undefined | decimal | Note: listStyle must already be set. | | image | string or string[] or undefined | undefined | 404 image | Note: listStyle must already be set. | | liMarkerCssSize | string or undefined | undefined | 1rem | CSS property value | | lightThemeHighlightColor | string or undefined | undefined | oklch(0.75 0.1229 12.71) | - | | darkThemeHighlightColor | string or undefined | undefined | oklch(0.81 0.1004 305.04) | - | | animation | boolean or { duration: string, timingFunction: string } or undefined | undefined | { duration: "0.8s", timingFunction: 'ease-in-out' } | - | | class | {title?: string, ul?: string, li?: string, a?: string} or or undefined | undefined | undefined | eg. {li: "py-1"} | | globalStyle | string or or undefined | undefined | undefined | eg. "ul {background-color: yellow;}" | | style | Object{title?: string, ul?: string, li?: string, a?: string} or or undefined | undefined | undefined | eg. {a: "font-style: italic;"} | | locale | string or undefined | undefined | en-US | eg. "zh-CN" // Note: The case of the locale variable should match the locale in your page URL. | | languageMap | Record<string, string> or undefined | undefined | {"de-DE": "Inhaltsverzeichnis","el-GR": "Περιεχόμενα","en-US": "Contents","es-ES": "Índice","fr-FR": "Sommaire","it-IT": "Indice","ja-JP": "目次","ko-KR": "목차","ru-RU": "Оглавление","th-TH": "สารบัญ","tr-TR": "İçindekiler","zh-CN": "目录","zh-Hant": "目錄"} | eg. {"en-US": "Table of Contents", "ja-JP": "目次"} |

Contribution

If you see any errors or room for improvement on this plugin, feel free to open an issues or pull request . Thank you in advance for contributing!