
Security News
The AI Industry Is Betting on Open Weights
An open letter signed by 50 companies, from NVIDIA and Microsoft to Mistral and Hugging Face, urges Washington not to restrict open weight AI.
@yqg/beetle
Advanced tools
Beetle is a toolkit for building web applications with Vue 3, TypeScript, and Vite. It provides a set of utilities and components to streamline development and improve performance.
beetle 是一款现代化的前端函数工具库,旨在提升日常开发效率与项目一致性。它不仅内置了完整的 lodash-es、dayjs 工具集,还结合了实际业务场景,集成多种高频使用的函数方法,帮助团队在高质量代码开发中减少重复造轮子。
beetle 主要具备以下特性:
🧰 内置 lodash-es 全量功能
开箱即用的 lodash-es 方法集合,涵盖常见的数据处理、数组操作、对象转换等能力,满足绝大多数业务开发场景。
📅 内置 dayjs 日期处理库
轻量级日期处理库(仅 2KB),支持时区转换、相对时间、多语言等插件扩展,API 与 Moment.js 保持一致。
⚙️ 融合业务场景的定制函数
集成多个结合公司业务特点封装的高频函数,提升复用率,统一项目函数风格,减少重复工作。
🌲 支持按需加载与 Tree Shaking
所有函数均可按需引入,自动支持 Tree Shaking,避免冗余打包,助力前端性能优化。
💡 良好的开发体验
统一的函数命名规范、丰富的类型提示与完善的单元测试,助你快速上手、放心使用。
beetle 适用于所有现代前端项目,尤其适合:
step1. 从master切release分支如: release/beetle_20250604 setp2. cicd 发布 ci地址 MODULE_NAME 选择 cn-web-yqg-beetle BUILD_ENV 选择:prod,最后点击确认 cd地址 BUILD_ENV 选择:prod 镜像选择要不输的版本,最后点击确认。
# install dependencies
$ pnpm install
# start dev server
$ pnpm dev
# 启动文档站点
$ pnpm doc:dev
# 打包工具库函数
$ pnpm build
# 安装 @yqg/beetle
npm install @yqg/beetle
# 或者使用 yarn
yarn add @yqg/beetle
# 或者使用 pnpm
pnpm add @yqg/beetle
类型定义说明:
- TypeScript 项目:
@types/lodash-es已包含在@yqg/beetle的依赖中,安装时会自动安装,无需单独安装。可以直接使用所有 lodash 方法并获得完整的类型推断。dayjs自带 TypeScript 类型定义,无需额外安装。- JavaScript 项目:可以直接使用所有 lodash 和 dayjs 方法。
// 按需引入(支持 Tree Shaking)
// 内置lodash-es 全量方法
import { cloneDeep, add } from '@yqg/beetle';
cloneDeep({});
console.log(add(1, 2));// 3
// 按需引入(支持 Tree Shaking)
// 自有函数
import { arrayToTree } from '@yqg/beetle';
arrayToTree([], { idKey: 'id', parentIdKey: 'parentId', childrenKey: 'children' });
// 全量引入 (会打包全部工具)
import b from '@yqg/beetle'
b.arrayToTree([], { idKey: 'id', parentIdKey: 'parentId', childrenKey: 'children' });
b.cloneDeep({});
// 基础使用
import { dayjs } from '@yqg/beetle';
dayjs().format('YYYY-MM-DD HH:mm:ss');
dayjs('2024-01-01').add(7, 'day').format('YYYY-MM-DD');
// 使用插件(需自行引入)
import { dayjs } from '@yqg/beetle';
import utc from 'dayjs/plugin/utc';
import timezone from 'dayjs/plugin/timezone';
import 'dayjs/locale/zh-cn';
dayjs.extend(utc);
dayjs.extend(timezone);
dayjs.locale('zh-cn');
// 时区转换
dayjs().tz('America/New_York').format('YYYY-MM-DD HH:mm:ss');
在使用过程中发现任何问题、或者有改善建议,欢迎在 GitLub Issues 进行反馈:https://gitlab.yangqianguan.com/web/yqg-beetle/-/issues
FAQs
Beetle is a toolkit for building web applications with Vue 3, TypeScript, and Vite. It provides a set of utilities and components to streamline development and improve performance.
The npm package @yqg/beetle receives a total of 34 weekly downloads. As such, @yqg/beetle popularity was classified as not popular.
We found that @yqg/beetle demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 33 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
An open letter signed by 50 companies, from NVIDIA and Microsoft to Mistral and Hugging Face, urges Washington not to restrict open weight AI.

Security News
/Research
A fake corepack.org site is impersonating the Node.js tool and delivers an infostealer and proxyware to developers who download it.

Research
/Security News
A large-scale campaign abused GitHub Actions in compromised repositories to exploit CVE-2026-41940 in cPanel and WHM and steal server credentials.