@aitianyu.cn/types
v0.1.3
Published
Common modules (types, functions, classes) for aitianyu
Maintainers
Readme
@aitianyu.cn/types
A comprehensive utility library providing base types, helper functions, and security utilities for the aitianyu ecosystem. Supports both Node.js and browser environments.
为 aitianyu 生态系统提供基础类型、帮助函数和安全工具的综合工具库,同时支持 Node.js 和浏览器运行环境。
Quick Start / 快速开始
npm install @aitianyu.cn/typesimport { guid, Log, StringHelper, TOTP, Base32, ObjectHelper } from "@aitianyu.cn/types";
// Generate a UUID / 生成 UUID
const id = guid();
// Format a string / 格式化字符串
const msg = StringHelper.format("Hello, {0}!", "world");
// Log a message / 记录日志
Log.info("Application started");
// Generate a TOTP secret / 生成 TOTP 密钥
const secret = TOTP.generate();Features / 功能特性
- Core Utilities / 核心工具 — Logging, environment detection, type conversion, error handling / 日志、运行环境检测、类型转换、错误处理
- Object Helpers / 对象帮助工具 — Deep clone, compare, string formatting, array and byte operations / 深度克隆、比较、字符串格式化、数组与字节操作
- Security / 安全模块 — TOTP, Base32, GUID/UUID, SHA hashing, RSA encryption, QR code generation / TOTP、Base32、GUID/UUID、SHA 哈希、RSA 加密、二维码生成
- Type Definitions / 类型定义 — Common interfaces, generic types, area codes, path utilities / 通用接口、泛型类型、区域码、路径工具
License
ISC © aitianyu.cn
