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-my

v0.4.0

Published

cross-miniprogram request helper — Alipay (my) platform package

Readme

@mini-dev/request-my

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

在原生 my.request 语义之上叠加增强:Promise 化、两段式拦截器、取消、超时、重试、缓存。原生入参 / 响应 / 错误原样透传,只增强、不归一。

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

平台差异在 engine 内收敛:支付宝 my.request 原生用 headers / status(与 canonical 一致,engine 出向 identity、无字段映射),入向 res.status → Response.statusCode、res.headers → Response.headers(无 cookies)。支付宝原生无分块事件,enableChunked 被忽略、原样透传,响应体在 success 一次性返回(非流)——不支持 chunked 流式。

安装

npm i @mini-dev/request-my

安装完成后,在支付宝小程序开发者工具里执行「同步小程序」(同步 npm 包),否则小程序无法识别 node_modules 里的包。

快速开始

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

request({
    url: 'http://127.0.0.1:8008/get',
    method: 'get',
    params: { name: 'xesam' }
})
    .then((res) => {
        console.log(res.data);
        console.log(res.statusCode);
        console.log(res.headers);
    })
    .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 | | createMyEngine | my 引擎工厂(augment-only createMethod 用) | | isTransientError | my 瞬态错误判定(err.error 数值码:2/4/14/19/20 终态,其余重试) | | createMethod / RequestError / Response / AbortController / AbortControllerPolyfill / AbortSignal / normalizeRequestOptions | 再导出核心能力 |

完整文档

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

License

ISC