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

@hucy_hucy/vue-request

v0.3.2

Published

基于axios的vue项目请求层封装的插件

Readme

开发进度

  • [x] api可以在页面中通过mapAction调用
  • [x] 支持动态url参数 类似这样 /api/task//
  • [] 支持自定义数据处理函数(api配置中, 回调函数实现), 插件配置中, 可配置统一数据处理函数, 自定义数据处理函数会优先于统一数据处理函数, 两者只会有一个执行
  • [x] 配置了dataType的接口数据存入数据池中
    • [x] 列表和其他类型有不同的存储逻辑
  • [x] 记录接口请求状态
    • [x] 主要有两种需求, 单个接口的请求状态(主要用于分接口异步加载)
    • [x] 多接口同时完成(主要用于等待页面完整加载完成)
    • [] 还有一种需求, 第一次进入页面的时候是等待所有接口完成, 后续就使用单个接口状态
  • [] 重复请求判断和可配置
    • [x]一般不允许某个接口可在短时间内 (100ms内) 重复请求
    • [x]但是可以通过配置来允许重复请求
    • []请求字典值的接口, 仅请求一次, 后续所有请求都忽略, 存储到本地localStorage, 再次请求的时候直接返回localStorage数据
  • [] 从数据池获取数据(根据唯一键获取)
    • [x] 可以通过 mapGetters 函数获取
    • [] 数据池数据缓存策略
    • [] 默认存储在内存, 刷新操作即丢失数据
    • [] 可以存储到 sessionStorage 中, 在运行期间都不会丢失数据, 若是再次请求接口, 会直接从缓存中读取, 并拦截请求, 若是不需要拦截, 可以配置(这种情况下始终使用请求返回数据, 并更新持久化数据)
    • [] 可以存储到localStorage中, 用户不清除缓存将会一直存在, 可以设置数据过期时间(sessionStorage 不可以设置过期时间)
  • [] 请求队列,最多同时进行5个并行请求
  • [] 两种配置, 一种是插件配置, 一种是api配置, 插件配置中可以设置api的默认配置, 若是用户不设置api的默认配置, 插件内部还有一份默认配置
    • [] api配置的优先级为, 用户配置 > 用户默认配置(通过插件配置传入) > 默认配置
  • [] 快捷调用
    • [] 令 this.$api.getList({ page: 2 }) 可以直接使用
    • [] 令 this.$dp.getList (uuid或者uuids) 可以直接拿到数据