@aitianyu.cn/client-base
v0.0.3
Published
Basic components for aitianyu nodejs client
Downloads
122
Readme
@aitianyu.cn/client-base
A Node.js client base library that provides HTTP, HTTPS, HTTP/2, TCP, UDP and WebSocket clients, browser-side XHR / Fetch utilities, binary file I/O, and built-in multi-language support.
Documentation
| Language | Link | |----------|------| | English | English Documentation | | 中文 | 中文文档 |
Installation
npm install @aitianyu.cn/client-baseQuick Start
import { net, web, file, MessageBundleBase } from "@aitianyu.cn/client-base";
import { AreaCode } from "@aitianyu.cn/types";
// Set global language (optional) | 设置全局语言(可选)
MessageBundleBase.language = AreaCode.zh_CN;
// HTTP GET request | HTTP GET 请求
const client = new net.HttpClient("api.example.com", "/v1/data", "GET");
await client.send();
console.log(client.response);Modules
| Module | Description |
|--------|-------------|
| net | HTTP / HTTPS / HTTP2 / TCP / UDP / WebSocket clients + RPC |
| web | Browser XHR loader, Fetch loader, XMLHttpFile loader |
| file | Binary file stream operator |
| MessageBundleBase | Global i18n / localization instance |
License
ISC — © [email protected]
