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

@mini-dev/request-wx

v0.4.0

Published

cross-miniprogram request helper — WeChat (wx) platform package

Downloads

23

Readme

@mini-dev/request-wx

跨微信 / 支付宝 / 抖音小程序 HTTP 请求库的微信(wx)平台包(TypeScript)。

在原生 wx.request 语义之上叠加增强:Promise 化、两段式拦截器、取消、超时、重试、缓存、chunked 流式。原生入参 / 响应 / 错误原样透传,只增强、不归一。唯一支持 chunked 流式(onHeadersReceived / onChunkReceived)的平台包。

范式与同仓 @mini-dev/location 一致:平台无关核心(@mini-dev/request,作为本包依赖自动引入)+ 平台包。

安装

npm i @mini-dev/request-wx

安装完成后,在微信开发者工具里执行一次「工具 → 构建 npm」,否则小程序无法识别 node_modules 里的包。

快速开始

const { request } = require('@mini-dev/request-wx');

// 参数与 wx.request 基本一致,但返回 Promise
request({
    url: 'http://127.0.0.1:8008/get',
    method: 'get',
    params: { name: 'xesam' }
})
    .then((res) => {
        console.log(res.data);       // 原生 wx.request 的 res.data,原样透传
        console.log(res.statusCode);
        console.log(res.headers);    // 等价于原生 res.header
    })
    .catch((err) => console.error(err));

库级控制(超时 / 重试 / 缓存 / 取消 / 拦截器)统一装在保留字段 ext 里,与原生参数隔离:

request({
    url: 'http://127.0.0.1:8008/delay/8',
    ext: { timeout: 3000, retry: 2, maxAge: 60000 }
});

主要导出

| 导出 | 说明 | | --- | --- | | request | 默认便捷单例(Promise + 两段式拦截器) | | createRequest(engine?) | 造独立实例 / 注入自定义 engine | | createWxEngine | wx 引擎工厂(augment-only createMethod 用) | | isTransientError | wx 瞬态错误判定(重试用) | | createMethod / RequestError / Response / ChunkThrough / AbortController / AbortControllerPolyfill / AbortSignal / normalizeRequestOptions | 再导出核心能力 |

完整文档

本包是 minidev-request monorepo 的微信平台包。完整设计、API、迁移指南与示例见仓库 README,微信示例工程见 sample-request-wechat。

License

ISC