# @dtone/dvs 中文文档

规范地址：https://npmcn.com/package/%40dtone/dvs/

版本：1\.3\.0
npm 元数据更新时间：2025-04-15T02:17:53.121Z
中文译文更新时间：2026-11-13T00:06:26.931Z
软件包许可：MIT

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

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

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

- 包体积（解压后）：25.3 kB，20 个文件
- 模块格式：CommonJS
- TypeScript 类型：未声明
- Node.js 要求：\>=12\.0\.0
- 运行依赖：4 个
- 首次发布：2021-06-01T10:09:18.873Z
- 最新版本发布：2025-04-15T01:51:13.536Z
- 近 30 天下载量：2766（2026-10-13 至 2026-11-11，npm 官方下载统计）
- 已发布版本数：5（近 12 个月 0 个）

## 中文简介

DT 1 节点的DVS SDK

## 安装

```sh
npm install @dtone/dvs
```

也可以使用：`pnpm add @dtone/dvs`、`yarn add @dtone/dvs`、`bun add @dtone/dvs`

## README

# dvs- api 数据

## 文档

DVS API 的文档可以找到 [这里](https://dvs-api-doc.dtone.com/)

## 安装

```bash
> npm i @dtone/dvs
```

## 样本使用情况

### 初始化

```javascript
const { DVS } = require('@dtone/dvs');

const dvs = new DVS({
  apiKey: 'your-api-key-here',
  apiSecret: 'your-api-secret-here'
});
```

### 获取 API 的全部页面

```javascript
(async function () {
  // initial pageing params
  const params = { page: 1, perPage: 10 },

    // initialize the async iterable object
    it = dvs.discovery.countries.get({ params });

  try {
    for await (let data of it) {
      console.log(JSON.stringify(data));
    }
  } catch (err) {
    console.log(JSON.stringify(err));
  }
})();
```

### 处理错误

```javascript
const { DVSAPIError } = require(@dtone/dvs');

try {
  const result = await dvs.discovery.countries.getByCountryIsoCode({ countryIsoCode: 'SGP' });
} catch (err) {
  if (err instanceof DVSAPIError) {
    console.log(err.status, err.statusText, err.data);
  }

  // other error like timeouts, network issues, wrong params etc
}
```

## API 文档

见 [这里](https://github.com/dtone/dtone-dvs-api-node-client/blob/main/api.md)

## 常见问题

### @dtone/dvs 是什么？

DT 1 节点的DVS SDK

### 如何安装 @dtone/dvs？

在项目目录运行 npm install @dtone/dvs，或使用 pnpm add / yarn add / bun add。

### @dtone/dvs 支持 TypeScript 吗？

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

### @dtone/dvs 支持 ESM 还是 CommonJS？

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

### @dtone/dvs 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=12\.0\.0。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @dtone/dvs 可以商用吗？

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

### @dtone/dvs 的下载量有多少？

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

### @dtone/dvs 还在维护吗？

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

