npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

libra-js-kit

v1.1.0

Published

A collection of JavaScript utility functions for various business systems

Readme

🛠️ libra-js-kit

一个专为各类业务系统打造的现代化 JavaScript 工具包,助你写出更优雅、更规范、更可维护的代码。

✨ 特性

  • 🚀 TypeScript 编写 — 类型安全,IDE 智能提示开箱即用
  • 🧱 Tree-shakable — 支持子路径导入,按需引入,零冗余
  • 📦 场景丰富 — 覆盖数组操作、类型判断、数据渲染、字符串处理、格式校验等常用场景
  • 单元测试 — 关键逻辑有测试覆盖,稳定可靠
  • 📖 模块化设计 — 每个功能独立成模块,结构清晰,易于扩展

📦 安装

npm install libra-js-kit
yarn add libra-js-kit
pnpm add libra-js-kit

环境要求:Node.js >= 16,TypeScript >= 5.0

🚀 快速开始

// 方式一:从主入口导入
import { arrayKit, validateKit } from 'libra-js-kit';

arrayKit.unique([1, 2, 2, 3]);          // [1, 2, 3]
validateKit.isValidEmail('[email protected]');     // true

// 方式二:子路径导入(推荐,支持 Tree-shaking)
import { chunk, groupBy } from 'libra-js-kit/array';
import { isValidPhone, isValidIDCard } from 'libra-js-kit/validate';

chunk([1, 2, 3, 4, 5], 2);              // [[1, 2], [3, 4], [5]]
isValidPhone('13800138000');             // true

📚 模块

| 模块 | 导入路径 | 说明 | |------|---------|------| | arrayKit | libra-js-kit/array | 数组操作:分块、去重、扁平化、分组、交集/差集、随机取值、转树形结构 | | dataTypeKit | libra-js-kit/dataType | 类型判断:isArrayisObjectisStringisPromise 等 17 个精准判断方法 | | libKit | libra-js-kit/lib | 通用工具:断言 assertDefined、默认值 defaultValue、空值判断等 | | renderKit | libra-js-kit/render | 数据渲染:布尔值、文件大小、百分比、时间范围、脱敏字符串、截断文本等 | | stringKit | libra-js-kit/string | 字符串处理:首字母大写、全大写/全小写、反转 | | validateKit | libra-js-kit/validate | 格式校验:身份证、手机号、邮箱、银行卡、车牌、统一社会信用代码等 17 项 |

📖 API 文档

完整 API 文档请查看 docs/README.md

📝 更新日志

版本变更记录请查看 CHANGELOG.md

📄 许可证

本项目基于 MIT 协议开源。

🤝 参与贡献

欢迎提交 Issue 反馈问题或提出改进建议,也欢迎直接提交 Pull Request。