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

quickapi

v0.0.3

Published

启动静态服务器及测试API Server

Downloads

4

Readme

quickapi

基于 koa 的web应用快速启动服务

  • 支持模拟API服务器
  • 支持文件系统服务器
  • 支持URL中包含参数
  • 可以切换generator是否具有编码特性

说明

为前后端分离的项目,提供简易快速的API模拟测试环境,使前后端可以更好的并行开发。

  • quickapi是基于 koa 的web应用框架,原生支持generator编码风格; 模拟api服务时,可直接使用 koa 相关的中间件(middleware)。

  • 可以直接使用原生js流程控制。

  • api server入口文件接收参数为: context、 next和path。

| 参数 | 说明 | | --- | --- | | context | koa中的context参数 | | next | koa中的next参数 | | path | 去掉api根路径 后的访问路径 |

  • 使用 path-to-regexp 解析参数,URL参数格式可以参考该工具。

  • 使用 koa-static作为文件服务器中间件

安装

npm 中安装:

npm install -g quickapi

运行

quickapi
quickapi -p 3003 -g -s ./server/genera\tors/server.js -f ./src/

CLI 配置

| 参数 | 默认值 | 说明 | | --- | --- | --- | | [-p] | 8170 | 设置服务器端口 | | [-s] | ./server/server.js | 设置api server入口文件路径 | | [-f] | . | 设置文件系统根目录 | | [-a] | /api | 设置api根路径 | | [-g] | | 设置是否使用generator风格server; 包含该参数则开启generator |

例子

从github中下载完整实例代码

git clone https://github.com/lawrencebla/quickapi-example.git

切换到实例代码目录

cd quickapi-example

开启服务

  • 不使用generator
quickapi example_common
  • 使用generator
quickapi example_generators

查看文件测试系统

查看API server测试系统

更多信息请查看quickapi-example仓库