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

yapi-plugin-api-doc

v0.2.1

Published

在标签页中加入查看接口文档,在线查看接口文档

Downloads

5

Readme

yapi-plugin-api-doc

根据内置导出数据插件,在分组的某个项目导航栏中加入接口文档标签,点击可以直接查看接口文档。

安装

第一步:在config.json这层目录下运行 yapi plugin --name yapi-plugin-api-doc 安装插件

第二步: 重启服务器

注:如果是第一次安装插件会安装依赖,由于node-sass安装极易失败可能导致插件安装失败,可以手动进入vendors手动安装npm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass/后再执行上述步骤重新安装插件。

更新

通过yapi-cli更新插件还是比较麻烦的,直接再执行一次命令并不会更新。因为yapi-cli安装插件实际上就是在vendors目录下执行npm install --registry https://registry.npm.taobao.org yapi-plugin-api-doc,所以最后会在package.json文件中记录下开始安装的版本号,再次执行安装的还是同一个版本。

执行如下操作可以进行更新:

  1. 进入vendors目录中,需要先清除ykit的缓存,删除node_modules/.ykit_cache文件夹
  2. 修改package.json里面yapi-plugin-api-doc的版本或者直接npm i yapi-plugin-api-doc@version
  3. 执行命令NODE_ENV=production ykit pack -m
  4. 在config.json这层目录下执行命令yapi plugin --name yapi-plugin-api-doc后再重启服务器就完成安装指定版本的插件

特性

项目接口文档

点击项目导航栏的接口文档,可以设置查看当前分组所有接口的文档。页面顶部有一个开关,用来设置当前分组的开放接口文档是否公开可见,打开开关之后可以看到公开访问地址。

每个接口编辑页面都可以设置当前接口是否为开放接口,如果是开放接口可以通过这边的设置来觉得是否开放为无需登录即可访问的接口。

全局接口文档

对于一个工程中有很多分组,一个分组又会有很多项目,这些分组和项目之间对外提供文档是需要一定顺序的。 点击右上角的头像会出现下拉选项,点击接口文档即可进入全局文档的设置界面。 当前支持在目录树上进行拖拽排序操作,轻松搞定文档的顺序。通过右侧给出的文档地址可以轻松访问。

公开访问

目前的YAPI不支持用户不登录进行访问操作,需要支持public接口的版本才能免登录公开访问