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 🙏

© 2025 – Pkg Stats / Ryan Hefner

vitepress-plugin-helper

v1.0.1

Published

A VitePress plugin that helps generate nav and sidebars and watch MarkDown file changes to restart the service

Downloads

30

Readme

vitepress-plugin-helper

一个 VitePress 插件,可以通过特定目录结构自动生成 navsidebar,并监听 MarkDown 文件更改自动重新生成菜单。通过 fast-glob 实现。

安装

npm install vitepress-plugin-helper -D

用法

import { DefaultTheme, defineConfig } from 'vitepress'
import { VitePressHelperPlugin } from 'vitepress-plugin-helper'
import { getNav, getSidebar } from './menu'


export default defineConfig({
  title: 'My Awesome Project',
  description: 'A VitePress Site',
  themeConfig: {
    nav: getNav(),
    
    sidebar: getSidebar(),
    
    socialLinks: [
      { icon: 'github', link: 'https://github.com/vuejs/vitepress' },
    ],
  },
  vite: {
    plugins: [
      VitePressHelperPlugin(),
    ],
  },
})

工作原理

  • 插件通过扫描 根目录 下的文件结构生成 navsidebarnav 的生成依赖于子目录的 index.md(targetMDFile), sidebar 的生成可以不提供 index.md(targetMDFile),但可以通过该文件自定义显示。

  • .vitepress/cache/plugin_helper_trigger.md 是服务启动时是否需要生成菜单的判断依据,删除后可以触发生成菜单。

nav 辅助生成

可以在 MarkDown 文件中提供以下内容:修改标题(title)、排序(order)、是否有侧边栏(sidebar)、是否忽略(ignore)和分组(group)导航栏

---
title: Title
order: 1
ignore: false
sidebar: true
group: true
---

sidebar 辅助生成

可以在 MarkDown 文件中提供以下内容:修改分组标题(title)、排序(order)、是否折叠(collapsed)和是否忽略(ignore)侧边栏

---
title: Title
order: 1
ignore: false // 高优先级
// targetMDFile
collapsed: false
link: false
---

查看示例:配置在docs配置在根目录指定源目录

预览

img.png