@cashfreepayments/cashfree-js

中文文档
1.0.7发布于 2026/03/26MITESM + CJS零依赖近 30 天下载 10.9万

cashfree.js loader

原始使用文档
文档目录3 节
  1. Installation
  2. Usage
  3. load

Cashfree.js ES Module

Installation

Use npm to install the Cashfree.js module:

npm install @cashfreepayments/cashfree-js

Usage

load

This function returns a Promise that resolves with a newly created Cashfree object once Cashfree.js has loaded. If you call load in a server environment it will resolve to null.

import {load} from '@cashfreepayments/cashfree-js';

const cashfree = await load({
    mode: "sandbox" //or production
});

For more information on how to use Cashfree.js, please refer to the Cashfree.js API reference or learn to accept a payment with Cashfree.

If you have deployed a Content Security Policy, make sure to [include Cashfree.js in your directives].

  • connect-src, https://api.cashfree.com
  • frame-src, https://sdk.cashfree.com, https://api.cashfree.com, https://sandbox.cashfree.com https://payments.cashfree.com, https://payments-test.cashfree.com
  • script-src, https://sdk.cashfree.com

版本与发布记录

@cashfreepayments/cashfree-js 共发布 8 个版本,首次发布于 2023/03/17;过去 12 个月发布了 2 个版本。

版本发布日期距今
1.0.7latest2026/03/267 个月前
1.0.62026/01/309 个月前
1.0.52024/07/022 年前
1.0.42023/03/293 年前
1.0.32023/03/173 年前
1.0.22023/03/173 年前

关于 @cashfreepayments/cashfree-js 的常见问题

@cashfreepayments/cashfree-js 是什么?

cashfree.js loader

如何安装 @cashfreepayments/cashfree-js?

在项目目录运行 npm install @cashfreepayments/cashfree-js,或使用 pnpm add / yarn add / bun add。

@cashfreepayments/cashfree-js 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/cashfreepayments__cashfree-js 是否存在。

@cashfreepayments/cashfree-js 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@cashfreepayments/cashfree-js 可以商用吗?

@cashfreepayments/cashfree-js 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@cashfreepayments/cashfree-js 的下载量有多少?

根据 npm 官方下载统计,@cashfreepayments/cashfree-js 在 2026/10/09 – 2026/11/07 这 30 天内被下载 109,345 次,日均约 3,645 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cashfreepayments/cashfree-js 还在维护吗?

最新版本 1.0.7 发布于 2026/03/26(7 个月前);至今共发布 8 个版本,其中过去 12 个月发布了 2 个;首次发布于 2023/03/17。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。