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

zero-mock-ui

v1.0.12

Published

A tool to change mock

Readme

zero-mock-ui

一个轻量的切换mock接口的UI组件。

zero-mock-ui 是框架无关的,可以在 Vue、React 或其他任何框架中使用。


功能特性

  • api列表存储(Storage)在 LocalStorage
  • 可通过提供的函数直接实时拿到当前的api列表的值

shootscreen shootscreen


版本说明

每个版本的详细说明请参阅 Changelog


上手

将 zero-mock-ui 添加到项目中采用以下方式:

使用 npm

$ npm install vconsole

Import 并初始化后,即可使用 onChange快速获取当前的api列表值。

import MockUI from 'zero-mock-ui';


// 使用配置参数来初始化,详情配置属性
const mockui = new MockUI({
    apiList:['queryNumber','queryList'],
    onChange: (v)=>{
        console.log(v)
        // { queryNumeber: 0, queryList: 0 } 
    }
});

配置属性

键名 | 类型 | 可选 | 默认值 | 描述 --------------------- | -------- | -------- | ------------------------------------------- | ------------------- apiList | string[] | false | - | 配置的api名称列表。每个名称必须是唯一的。 onChange | function(value) | true | - | 回调方法,变化的时候触发。初始化后也会触发 isShowGrayHost | boolean | true | true | 是否展示灰度host的ui

值的存储

存在localStorage里, 可以通过如下方法获得

localStorage.getItem('apiListValueObj')

也可以通过onChange函数来获取

0: 预发host 1: 灰度host 2:线上host 3:zero-mock

zero-mock平台

官方地址:zero-mock

简单、高效、好用的在线API管理平台 本地无需任何开发,讲请求根地址指向到模拟地址即可轻松实现接口模拟, 快速生成演示数据,只需要开发前端即可向客户演示真实效果。


交流反馈

erp:zhangduole