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

@maksiks/markdown-it-image-caption

v1.1.2

Published

Cleanly add a <figcaption> to your markdown-it images.

Readme

🌃 markdown-it-image-caption (wizardified)

Note: this is a fork of @andatoshiki/markdown-it-image-caption but with full TypeScript support, no unnecessary <strong> tags and extra features.

This markdown-it plugin allows you to easily wrap your markdown images in <figure> and add a <figcaption> to them if you add an extra string after the image source. You can optionally leave it as an <img> or just a standalone <figure> without a caption as well, and style them.

📦 Install

pnpm i @maksiks/markdown-it-image-caption

✏️ The syntax:

![alt-text](image-source 'caption | position | class')

🧩 Example:

import markdownit from 'markdown-it';
import mditimgcap from '@maksiks/markdown-it-image-caption';

const md = markdownit()
    .use(mditimgcap);

const text = md.render("![ngc-6992 (a really cool nebula)](https://i.redd.it/ggfqw7m7vbzz.jpg 'Heeeey! Look at me, I&apos;m a caption! | | md-fig')");

And with some extra CSS,

✨ This renders into:

example I'm also a caption, hello how are you?

Note: if there is no caption provided e.g. a decorative image, it will be an <img> like usual. If you want to keep it a <figure> for semantic or other reasons, replace the caption with :::nocaption like this:

![alt-text](image-source ':::nocaption')

📜 Options

You can put the <figcaption> over or under the image by adding | top, otherwise or if unset it defaults to bottom:

![alt-text](image-source 'Wow! A frog! | top')

To style the figures you can optionally assign a class to each, globally:

import mditimgcap from '@maksiksq/markdown-it-image-caption';

const md = markdownit()
        .use(mditimgcap, {
           figClasslist: 'neat-fig',
        });

or individually:

![alt-text](image-source 'Wow! A frog! || my-class')

Use CSS selectors if you want to access the elements inside. All of these are fully optional, simplicity is key to achieving frogs.

![alt-text](image-source 'Wow! A frog!')