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

vitepress-plugin-package-managers

v0.2.1

Published

Display package manager commands with synced, persistent tabs for VitePress

Readme

vitepress-plugin-package-managers

Display package manager commands with synced, persistent tabs for VitePress. Users pick their package manager once — the choice is remembered across pages and browser sessions.

Inspired by starlight-package-managers.

Install

npm install vitepress-plugin-package-managers

Setup

1. Register the markdown plugin

// .vitepress/config.mts
import { packageManagersMarkdownPlugin } from "vitepress-plugin-package-managers";

export default defineConfig({
  markdown: {
    config(md) {
      md.use(packageManagersMarkdownPlugin);
    },
  },
});

2. Register the Vue components

// .vitepress/theme/index.ts
import { enhanceAppWithPackageManagers } from "vitepress-plugin-package-managers/client";

export default {
  extends: DefaultTheme,
  enhanceApp({ app }) {
    enhanceAppWithPackageManagers(app);
  },
};

With icons

Icons are opt-in for tree-shaking. Import the preset and pass it:

import { enhanceAppWithPackageManagers } from "vitepress-plugin-package-managers/client";
import { icons } from "vitepress-plugin-package-managers/icons";

enhanceAppWithPackageManagers(app, { icons });

Usage

Markdown syntax

The simplest way — use :::pm-<type> containers directly in .md files:

::: pm-add gramio
:::

::: pm-add -D @gramio/types
:::

::: pm-run dev
:::

::: pm-install
:::

::: pm-create gramio
:::

::: pm-dlx gramio
:::

::: pm-remove gramio
:::

Vue component

For more control, use the <PackageManagers> component:

<PackageManagers pkg="gramio" />

<PackageManagers pkg="@gramio/types" dev />

<PackageManagers type="run" pkg="dev" />

<PackageManagers type="install" />

<PackageManagers type="create" pkg="gramio" />

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | pkg | string | — | Package name | | type | "add" \| "create" \| "dlx" \| "exec" \| "install" \| "run" \| "remove" | "add" | Command type | | dev | boolean | false | Add as dev dependency (-D / -d) | | args | string | — | Extra arguments appended to the command | | prefix | string | — | Prefix prepended to the command (e.g. sudo) | | comment | string | — | Comment line above the command. {PKG} is replaced with the manager name | | jsr | string | — | JSR package specifier (see JSR support) | | pkgManagers | PackageManager[] | ["npm", "yarn", "pnpm", "bun"] | Which tabs to show |

JSR support

Pass the jsr prop to generate correct commands for every package manager:

<PackageManagers jsr="@gramio/bot" />

Generates:

| Manager | Command | |---------|---------| | npm | npx jsr add @gramio/bot | | yarn | yarn dlx jsr add @gramio/bot | | pnpm | pnpm dlx jsr add @gramio/bot | | bun | bunx jsr add @gramio/bot | | deno | deno add jsr:@gramio/bot |

Navbar switcher

PackageManagerSwitch is a dropdown you can put in the navbar so users can change their preference from anywhere:

<!-- .vitepress/theme/Layout.vue -->
<script setup>
import DefaultTheme from "vitepress/theme";
import { PackageManagerSwitch } from "vitepress-plugin-package-managers/client";
</script>

<template>
  <DefaultTheme.Layout>
    <template #nav-bar-content-after>
      <PackageManagerSwitch />
    </template>
  </DefaultTheme.Layout>
</template>

Persistence

All components share state through three mechanisms:

  1. localStorage — persists the choice across pages and sessions
  2. CustomEvent — syncs all instances on the same page instantly
  3. storage event — syncs across browser tabs

Supported package managers

npm, yarn, pnpm, bun, deno, ni

Default: ["npm", "yarn", "pnpm", "bun"]

Icons

Icons are not bundled by default — you opt in for tree-shaking.

// Use all built-in icons (npm, yarn, pnpm, bun, deno)
import { icons } from "vitepress-plugin-package-managers/icons";
enhanceAppWithPackageManagers(app, { icons });

Cherry-pick only what you need:

import { npm, bun } from "vitepress-plugin-package-managers/icons";
enhanceAppWithPackageManagers(app, { icons: { npm, bun } });

Use your own SVG or disable an icon:

import { icons } from "vitepress-plugin-package-managers/icons";
enhanceAppWithPackageManagers(app, {
  icons: {
    ...icons,
    bun: '<svg>...</svg>',  // custom SVG
    npm: false,              // hide icon
  }
});

Configuring defaults

Pass options to the markdown plugin to change the default set of package managers:

md.use(packageManagersMarkdownPlugin, {
  pkgManagers: ["npm", "pnpm", "bun"],
});

Or per-instance via the pkgManagers prop:

<PackageManagers pkg="gramio" :pkg-managers='["npm", "bun", "deno"]' />

License

MIT