# @ecomplus/client 中文文档

规范地址：https://npmcn.com/package/%40ecomplus/client/

版本：2\.4\.0
npm 元数据更新时间：2024-10-08T22:02:42.131Z
中文译文更新时间：2026-11-13T05:58:26.755Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40ecomplus/client
原文对照：https://npmcn.com/package/%40ecomplus/client/?lang=original
项目主页：https://github.com/ecomplus/client#readme
源码仓库：https://github.com/ecomplus/client

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：1.9 MB，38 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：未声明
- 运行依赖：2 个
- peer 依赖：@ecomplus/utils 1\.x
- 首次发布：2019-07-05T20:48:01.021Z
- 最新版本发布：2024-10-08T22:02:41.936Z
- 近 30 天下载量：5729（2026-10-13 至 2026-11-11，npm 官方下载统计）
- 已发布版本数：36（近 12 个月 0 个）

## 中文简介

E-Com+REST API的JS客户端

## 安装

```sh
npm install @ecomplus/client
```

也可以使用：`pnpm add @ecomplus/client`、`yarn add @ecomplus/client`、`bun add @ecomplus/client`

## README

# 电子商务加客户端

[![Publish](https://github.com/ecomplus/client/workflows/Publish/badge.svg)](https://github.com/ecomplus/client/actions?workflow=Publish) [![CodeFactor](https://www.codefactor.io/repository/github/ecomplus/client/badge)](https://www.codefactor.io/repository/github/ecomplus/client) [![npm version](https://img.shields.io/npm/v/@ecomplus/client.svg)](https://www.npmjs.org/@ecomplus/client) [![License MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

E-Com+REST API的JS客户端

[变化](https://github.com/ecomplus/client/blob/master/CHANGELOG.md)

## 使用量

**TL; DR 数据**: 我们有 [方法](https://developers.e-com.plus/client/ecomClient.html) 运行几乎所有 E-Com Plus API 的请求,但您可能正在搜索 [存储 API](https://developers.e-com.plus/client/ecomClient.html#.store)。 。 。 .

这个 `@ecomplus/client` 软件包提供 [方法清单](https://developers.e-com.plus/client/ecomClient.html),每个功能是请求特定的E-Com Plus REST API,使用 [轴](https://github.com/axios/axios) HTTP 客户端并返回 a [答应](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)。 。 。 .

它既适用于Node.js环境,也适用于浏览器环境.

-   [开始吧](https://developers.e-com.plus/client/module-@ecomplus_client.html)
-   [方法](https://developers.e-com.plus/client/ecomClient.html)

### 存储 API 请求示例

```js
import { store } from '@ecomplus/client'

const authenticationId = 'myAuthenticationId'
const accessToken = 'myAccessToken'

ecomClient.store({
  url: '/products.json',
  authenticationId,
  accessToken,
  method: 'post',
  data: { sku: '123', name: 'Sample Prduct 123' }
})
  .then(({ data, status }) => console.log(status, data))
  .catch(error => console.error(error))
```

### 依赖关系

它要求 _可能不会_ 包含 `core-js`, (中文(简体) ), [`axios`](https://github.com/axios/axios) 财务报告和审定财务报表 [`@ecomplus/utils`](https://github.com/ecomplus/utils)。 。 。 .

#### 节点.js

```bash
npm i --save @ecomplus/utils @ecomplus/client
```

#### 网络软件包

```bash
npm i --save core-js @ecomplus/utils @ecomplus/client
```

#### 光盘N

```html
<script src="https://cdn.jsdelivr.net/npm/@ecomplus/client/dist/ecom-client.polyfill.min.js"></script>
```

`axios` 财务报告和审定财务报表 `ecomUtils` 图书馆 **必须单独列入** 并可在窗口瞄准镜上找到.

## 发展

叉/ 连接此寄存器并安装依赖性 :

```bash
git clone https://github.com/ecomplus/client
cd client
npm i
```

然后可以在本地编辑源文件并测试 `npm run serve`。 。 。 .

### 捐款

请读一下 [捐款准则](https://npmcn.com/package/%40ecomplus/client/CONTRIBUTING.md)。 。 。 .

### 部署

看看这个 `package.json` 脚本 :

-   `npm run doc` - 更新生成的jsdoc/docdash文件;
-   `npm run release` - 生成更改日志和新版本;

## 常见问题

### @ecomplus/client 是什么？

E-Com\+REST API的JS客户端

### 如何安装 @ecomplus/client？

在项目目录运行 npm install @ecomplus/client，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：@ecomplus/utils（1\.x）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @ecomplus/client 支持 TypeScript 吗？

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

### @ecomplus/client 支持 ESM 还是 CommonJS？

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

### @ecomplus/client 可以商用吗？

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

### @ecomplus/client 的下载量有多少？

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

### @ecomplus/client 还在维护吗？

最新版本 2\.4\.0 发布于 2024/10/09（2 年前）；至今共发布 36 个版本，其中过去 12 个月发布了 0 个；首次发布于 2019/07/06。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

