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

asrv

v0.2.1-alpha.2

Published

A server-side tool that assists front-end development.

Readme

asrv

Node.js CI

一个开发助手服务,结合了Mockjsjson-server快速生成符合REST API规范接口。

快速定义接口能够获取数据,对数据进行操作。

特性

  • 添加了mock功能,使用mockjs生成数据
  • 添加了json-server功能,使用json-server生成REST API规范接口
  • 可以对json-server输出的结果进行拦截,从而达到接口返回的结果与日常使用数据一致
  • 添加了代理功能,而且代理配置与vite代理配置一致
  • 集成了swagger,可以通过swagger注释生成接口文档
  • 添加日志功能

文档

windyeasy.github.io/asrv

安装

npm install asrv -D

使用

创建一个asrv.config.js或者asrv.config.ts文件,导出了defineConfig提供了更好配置体验。

下面的案例结合了mockjs和json-server的基础使用,更多mockjs的使用方法请查看mockjs,jonson-server用法请查看json-server

import { defineConfig, mock } from 'asrv'

export default defineConfig({
  port: 9000,
  server: {
    db: {
      user: [
        {
          id: 1,
          name: '张三'
        },
        {
          id: 2,
          name: '李四'
        }
      ]
    }
  },
})

在控制台使用CLI,默认会查询项目根目录的asrv.config.js/asrv.config.ts/asrv.config.mjs等文件。

npx asrv

指定配置文件

npx asrv -c ./config.js

package.json中添加脚本

{
  "scripts": {
    "server": "asrv" // or "asrv -c ./config.js"
  }
}
# 生成了REST API接口
$ curl http://localhost:9000/user
[
  {
    "id": 1,
    "name": '张三'
  },
  {
    "id": 2,
    "name": '李四'
  }
]

TODO

  • [ ] 使用默认port被占用往前递增
  • [ ] db.json通过配置项关闭db.json文件生成
  • [ ] 隔一段时间刷新数据
  • [ ] server-plugin
    • [ ] ws处理
  • [ ] 贡献指南

License

MIT License © windyeasy