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

@monorepo-setup/pkg-utils

v0.0.1

Published

comprehensive utility library for monorepo demonstration - includes TypeScript types, async utilities, validation, caching, event system, and performance monitoring

Readme

pkg-utils

一个全面的 TypeScript 工具库,专为 monorepo 项目设计,展示各种前端开发场景的最佳实践。

🚀 特性

📊 基础常量和配置

  • 常量导出: one, two
  • 配置对象: CONFIG - 包含 API URL、超时、版本等
  • 枚举类型: Status, Priority - 状态和优先级管理

🧩 TypeScript 类型定义

  • 接口: User, Role, Permission - 用户权限系统
  • 泛型类型: ApiResponse<T>, AsyncResult<T>, EventHandler<T>
  • 工具类型: ValidatorRule<T> - 验证规则配置

🛠️ 功能模块

  • 数学工具 - 数值计算、范围限制、随机数生成
  • 字符串工具 - 格式化、转换、截断处理
  • 数组工具 - 去重、分组、分块操作
  • 对象工具 - 深拷贝、属性选择、数据转换
  • 异步工具 - 延迟、超时、重试、批量处理
  • 数据验证 - 类型安全的验证框架
  • 事件系统 - 类型安全的事件发射器
  • 缓存系统 - LRU 缓存实现
  • 错误处理 - 自定义错误类和安全包装
  • 日期工具 - 格式化、计算、判断
  • 性能监控 - 执行时间测量和指标收集

📦 安装和使用

# 在 monorepo 内使用
pnpm add pkg-utils@workspace:*

基本用法

// 按需导入(推荐)
import { clamp, capitalize, unique } from 'pkg-utils'

// 模块化导入(最佳 tree-shaking)
import { clamp } from 'pkg-utils/math'
import { capitalize } from 'pkg-utils/string'

📋 文档和示例

  • examples/ - 完整使用示例
  • src/ - 源码和 TypeScript 类型定义
  • test/ - 单元测试覆盖

🧪 开发

pnpm test              # 运行测试
pnpm build             # 构建发布版本