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

@yeepay/yop-nodejs-sdk

v3.1.3

Published

YOP NodeJS SDK with TypeScript support

Downloads

287

Readme

@yeepay/yop-nodejs-sdk (TypeScript)

本项目已废弃,请使用 yop-typescript-sdk

npm version npm downloads

项目结构

├── CHANGELOG.md 版本变更
├── LICENSE
├── README.md
├── src/ TypeScript 源代码目录
│   ├── Util/ 工具目录
│   │   ├── GetUniqueId.ts
│   │   ├── HttpUtils.ts
│   │   ├── RsaV3Util.ts          //rsa签名工具
│   │   ├── CashierSupport.ts     //收银台的签名算法
│   │   └── VerifyUtils.ts        //业务结果签名和商户通知进行校验
│   ├── test/ 示例代码
│   │   └── request.ts            //请求示例
│   ├── types.ts                  //类型定义
│   └── index.ts                  //入口文件
├── dist/ 编译后的 JavaScript 代码 (自动生成)
├── tsconfig.json                 //TypeScript 配置
├── jest.config.js               //Jest 测试配置
├── package-lock.json
└── package.json

快速开始

前置条件

  • Node.js 18+
  • 飞书项目系统账号和API凭证

安装

npm install @yeepay/yop-nodejs-sdk

使用示例 (TypeScript)

import { RsaV3Util } from '@yeepay/yop-nodejs-sdk';

// 配置选项
const options = {
  appKey: '你的appKey',
  secretKey: '你的私钥',
  serverRoot: 'xxx',  // 公网地址
  yopPublicKey: 'xxxx', // YOP公钥
  config: {
    contentType: 'application/x-www-form-urlencoded'
  }
};

// 获取认证头
const authHeaders = RsaV3Util.getAuthHeaders({
  ...options,
  url: '/rest/v3.0/auth/idcard',
  method: 'POST',
  params: {
    request_flow_id: 'xxxx',
    name: 'xxx',
    id_card_number: 'xxxx',
  }
});

console.log(authHeaders);

常见问题

1、文件上传

问题:报错”上传文件 merQual 参数key没有指定!“ 原因:上传的file文件为空,检查是否读取到本地的文件流

2、响应结果验签

问题:为什么是接口返回的未经转换的res.data字符串 原因:JSON.parse会改变原有的Number类型精度,导致验签失败

开发

安装

npm install

构建项目

npm run build

开发模式

npm run dev

运行示例

npm start

运行测试

npm test

使用GitHub Actions自动发布

  1. 创建GitHub Release
    • 在GitHub仓库页面,点击"Releases"
    • 点击"Create a new release"
    • 输入版本号(例如v1.0.0)
    • 添加发布说明
    • 点击"Publish release"

GitHub Actions将自动运行工作流,将包发布到npm。