有赞云网关 SDK for Node 使用教程

有赞云网关 SDK for Node 使用教程

open-sdk-node有赞云网关 SDK for Node项目地址:https://gitcode.com/gh_mirrors/op/open-sdk-node

1. 项目的目录结构及介绍

open-sdk-node/
├── adaptor/
├── client/
├── code-gen/
├── consts/
├── dispatcher/
├── doc/
├── http/
├── logger/
├── typings/
├── utils/
├── ws-client/
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .prettierignore
├── .prettierrc.json
├── LICENSE
├── README.md
├── README.zh.md
├── index.ts
├── jest.config.ts
├── package.json
├── rollup.config.js
├── tsconfig.json
└── yarn.lock

目录结构介绍

  • adaptor/: 适配器相关文件。
  • client/: 客户端相关文件。
  • code-gen/: 代码生成相关文件。
  • consts/: 常量定义文件。
  • dispatcher/: 分发器相关文件。
  • doc/: 文档文件。
  • http/: HTTP 相关文件。
  • logger/: 日志相关文件。
  • typings/: 类型定义文件。
  • utils/: 工具类文件。
  • ws-client/: WebSocket 客户端相关文件。
  • .eslintignore: ESLint 忽略配置文件。
  • .eslintrc.js: ESLint 配置文件。
  • .gitignore: Git 忽略配置文件。
  • .prettierignore: Prettier 忽略配置文件。
  • .prettierrc.json: Prettier 配置文件。
  • LICENSE: 项目许可证。
  • README.md: 项目英文介绍文档。
  • README.zh.md: 项目中文介绍文档。
  • index.ts: 项目入口文件。
  • jest.config.ts: Jest 测试配置文件。
  • package.json: 项目依赖和脚本配置文件。
  • rollup.config.js: Rollup 打包配置文件。
  • tsconfig.json: TypeScript 配置文件。
  • yarn.lock: Yarn 锁定文件。

2. 项目的启动文件介绍

项目的启动文件是 index.ts。这个文件是整个项目的入口点,负责初始化和启动整个应用程序。

// index.ts
import { start } from './app';

start();

3. 项目的配置文件介绍

package.json

package.json 文件包含了项目的依赖、脚本和其他元数据。

{
  "name": "open-sdk-node",
  "version": "1.0.0",
  "description": "有赞云网关 SDK for Node",
  "main": "index.ts",
  "scripts": {
    "build": "rollup -c",
    "test": "jest"
  },
  "dependencies": {
    "axios": "^0.21.1",
    "ws": "^7.4.5"
  },
  "devDependencies": {
    "@types/jest": "^26.0.20",
    "jest": "^26.6.3",
    "rollup": "^2.38.5",
    "typescript": "^4.1.3"
  }
}

.eslintrc.js

.eslintrc.js 文件是 ESLint 的配置文件,用于定义代码风格和规则。

module.exports = {
  root: true,
  parser: '@typescript-eslint/parser',
  plugins: [
    '@typescript-eslint',
  ],
  extends: [
    'eslint:recommended',
    'plugin:@typescript-eslint/recommended',
  ],
};

tsconfig.json

tsconfig.json 文件是 TypeScript 的配置文件,用于定义 TypeScript 编译选项。

{
  "compilerOptions": {
    "target": "ES2020",
    "module": "commonjs",
    "outDir": "./dist",
    "strict": true,
    "esModuleInterop": true
  },
  "include": [
    "src/**/*"
 

open-sdk-node有赞云网关 SDK for Node项目地址:https://gitcode.com/gh_mirrors/op/open-sdk-node

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

宣连璐Maura

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值