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

rd-acquiring-cashier

v0.1.0

Published

Cashier payment API client with RD headers (browser).

Readme

rd-acquiring-cashier

浏览器侧收银台 HTTP 客户端:按 env 拼接后端根地址,并在每次请求合并 RD 请求头(与主站 lib/rdHeaders.ts + riskCollector 行为一致)。

安装

从 npm 安装:

npm install rd-acquiring-cashier

在 monorepo 中作为 workspace 子包时,在仓库根目录执行 npm install 即可解析本地链接(已配置 workspaces 时依赖会一并安装)。

克隆本仓库后在本包目录开发与构建:

cd rd-acquiring-cashier && npm install && npm run build

类型检查(不写出 dist):

npm run typecheck

产物:使用 tsup 输出 ESM(*.mjs)+ CJS(*.cjspackage.jsonexports 提供 import / require / typescrypto-js 外置,随本包安装,构建不打进 bundle。已设 sideEffects: false 以利于树摇。

发布与 dist 约定

  • files 仅包含 dist,不会把 src 打进 npm 包。
  • prepack:在生成 tarball 之前执行 npm run buildnpm packnpm publish 都会触发,因此发布或本地 npm pack 校验前都会得到最新 dist(若更倾向只在发布时构建,可改为 prepublishOnly,但 npm pack 不会执行 prepublishOnly,需自行先 build)。
  • Git 与 dist(二选一,团队统一即可)
    • A. 不提交 dist:仓库只存源码,CI / 发布机在 npm publish 时由 prepack 现编 dist(若根目录 .gitignore 已包含 dist/,保持不将 dist 纳入版本控制即可;若历史上已跟踪 dist,需 git rm -r --cached dist 等清理后统一策略)。
    • B. 提交 dist:便于通过 Git 依赖直装,但易与源码不同步;发 npm 时 tarball 内产物仍由 prepack 在发包时覆盖为当前构建结果。

使用

HTTP 客户端(rd-acquiring-cashier/core

仅调用 API 时建议使用 core 子路径,与 UI 分层,利于按需打包。

import { createCashierClient } from "rd-acquiring-cashier/core";

const client = createCashierClient({ env: "uat" });

const detail = await client.fetchCashierDetail("ORDER_ID");
const status = await client.fetchCashierStatus("ORDER_ID");
const addr = await client.selectChainAddress("ORDER_ID", {
  chain: "ETH",
  currency: "USDT",
});

UI / 宿主集成(rd-acquiring-cashier/ui

收银页面或嵌入宿主从 ui 引入:再导出 core 全部公共 API,并包含 UI 常量与 CashierUIMountOptions(后续可在此扩展 mount 等)。

import {
  CASHIER_SDK_UI_VERSION,
  createCashierClient,
  type CashierUIMountOptions,
} from "rd-acquiring-cashier/ui";

包根 rd-acquiring-cashier./core 导出一致;需要 UI 子路径时请使用 ./ui

env 与后端地址

SDK 仅支持 uatprod(dev / fat 请走商户后端或本站 BFF,勿直连本包)。

CORS

从第三方域名调用上述 API 时,需后端网关配置允许该来源的 CORS;否则请在商户 同源后端 转发请求,或仅在本站收银域名内使用该 SDK。