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

@poty/http

v0.3.2

Published

Poty http lib.

Readme

@poty/http

Poty HTTP是一个基于 Poty 框架的服务器框架

Poty HTTP应该仅提供一个http服务器中间件,不处理具体的请求

description

@Guard 首先,由客户端发起请求,所有请求都应该先进行接口权限认证,读取路由和headers进行权限判断;

@Parser 权限通过之后,开始处理请求体解析,如果路由单独配置了解析器,则优先使用,否则使用默认配置的解析器,默认解析器应该支持根据请求content-type进行解析

@Validator 解析完成之后,可以先加一层校验器,方便服务器对客户端参数进行一次校验

@API @GET @PUT @POST @ALL 校验通过之后,转发到路由处理函数,并根据处理函数配置参数进行传参,函数可以是同步的也可以是异步的,处理完成之后,其返回值应该是处理结果,如果有问题,应该抛错误

@Pipe 处理结果不论成功还是失败,都应该进行一次响应前的拦截,以便服务器对结果进行统一封装

此外还应该有

defaultRoute 默认的路由处理函数,以防用户访问了一个未知的地址

封装之后的内容,由Poty-http和服务器库发送至客户端

@poty/http 应该支持以下功能

  • [x] @Guard 权限校验
  • [x] @Parser 请求体解析
  • [x] @Validator 配置校验数据,在全局校验器中校验
  • [x] @API 常见的请求方式,同时应该支持静态页面服务
  • [x] @Pipe 响应过滤器
  • [x] defaultRoute 默认请求处理
  • [ ] 考虑对微服务的支持