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

pageserve

v1.0.5

Published

通用分页的一个类方便于实现 分页 和 下拉分页的操作

Readme

个人使用的一个分页通用性的封装 封装的ts版本并未上传

邮箱 [email protected] 这是本人的邮箱 又不懂的 可以发邮箱给我(This is my email address and do not understand can send email to me) 主要看这里的配置

{
    params:{
      pageSize:this.pageSize,
      currentPage:this.currentPage,
    },  // 分页参数
    notPage:true, // notpage是否分页 默认ture分页也就是不会保留上次数据 false 上次数据和新数据合并
    keys:[], // 要处理的请求对象的属性
    totalKey:null,  // 总数的字段
  }

使用

// 首先有一个方法 必须返回promise
// 方法参数是解构函数 必须存在pageSize和currentPage
getList({pageSize:size,currentPage:current,...这里按照你的业务配置参数}){
  return new Promise((resolve,reject)=>{
    // 请求接口 这里写你请求接口的代码
    // 返回数据 从后端请求过来的数据
    // 如
    resolve({
      list:{
        data:[...]
      },
      total:20,
    })
  })
}

// 然后初始化分页服务类 方法必传
const pageServe = new PageService(getList,{
  // 这里放入配置 配置中想改什么配置写什么配置
  params:{
    // 这里是请求的参数比如 getList 有个自定义属性为name 那么这里加name即可
    // 默认分页数量是10 当前页为1 可自行在下面列表配置
    name:'测试数据'
  },
  // 这里配置就是拿到你对应的分页数据的属性
  keys:['list','data'],
  // 这个配置就是总数属性
  totalKey:'total',
  // 这个配置就是是否分页 默认是true 会重置上次数据并将新数据放入
  // 如果是false 上次数据和新数据合并
  notPage:false,
})

// 开始请求
pageSeve.getPageList();
···

1.0.5
放弃ts版本 为防止下载时需要 按照解析ts的工具 并加入默认导出