其他工具
一些其他实用的工具项目。
captcha-pro
行为验证码
轻量级行为验证码库,支持滑动拼图和点选验证,框架无关。
ts
import { SliderCaptcha } from 'captcha-pro'
const captcha = new SliderCaptcha({
container: '#captcha',
onSuccess: (token) => {
console.log('验证成功:', token)
}
})x-ai-chat
AI 聊天组件
[GitHub)
AI 聊天组件,支持多种 AI 模型接入。
await-to-done
async/await 错误处理
简化 async/await 错误处理的工具函数。
ts
import { to } from 'await-to-done'
const [err, data] = await to(fetchData())
if (err) {
console.error(err)
return
}
console.log(data)axios-series
Axios 序列化扩展
扩展 Axios 使其返回序列化结果。
ts
import { createAxios } from 'axios-series'
const api = createAxios({
baseURL: '/api'
})
// 返回 { data, error, loading }
const result = await api.get('/users')userdir
跨平台用户目录
[GitHub)
获取跨平台用户主目录的简单工具。
ts
import { userdir } from 'userdir'
const home = userdir()
// macOS: /Users/username
// Windows: C:\Users\username
// Linux: /home/usernameclipboard-parser
剪贴板解析器
[GitHub)
剪贴板解析器,支持解析 @RequestParam/@ApiModelProperty 接口定义代码、Word、Excel 以及其他表格类数据。
postmessager
iframe 通信方案
[GitHub)
iframe postMessage 通信整体解决方案。
统计
| 项目 | Stars |
|---|---|
| await-to-done | ⭐ 4 |
| userdir | ⭐ 3 |
| axios-series | ⭐ 3 |
| untiljs | ⭐ 2 |