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

heom-request

v1.1.0

Published

``` request(url [,callback] [,test]) request(options [,callback] [,test]) ```

Readme

request(url [,callback] [,test])
request(options [,callback] [,test])
  • url : <string> : 如果 url 是一个字符串,则会解析为 options。
  • options : <Object> : 在 http.request 的 options 的基础上有所改进。
    • noEnd : <boolean> : 不调用 request.end()。
    • data : <string> | <Buffer> : 如果 noEnd 为假,将调用 request.end(data)。
    • timeout : <number> : 默认为 60000,以毫秒为单位。
  • callback : <Function> : 回调函数,当 test 为假时为 (error, response),当 test 为真时为 (error, statusCode)。
    • error : <Error> : 被捕获的错误。
    • response : <http(s).IncomingMessage> : 它可用于访问响应状态、消息头、以及数据。
      • data : <string> : 数据。
      • json : <JSON> : 数据的 JSON,如果数据不是 JSON 的格式,则为 null。
    • statusCode : <number> : 发送到客户端的状态码。
  • test : <boolean> : 测试模式,当收到此请求的响应后即中断。
request.promise(url [,test])
request.promise(options [,test])
  • 它们返回 Promise 对象而不是使用回调。

###'timeout' 事件

当 'timeout' 事件触发时,将触发一次 'error' 事件。

###'error' 事件

当 'error' 事件触发时,将调用一次 callback(error, null)。

###'close' 事件

当 'close' 事件触发时,将调用一次 callback(null, response)。