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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@tofrankie/utils

v0.0.1-alpha

Published

Modern JavaScript utility functions library

Readme

JavaScript Utils

npm version npm downloads Build Status Coverage License: MIT TypeScript Node.js pnpm

现代化的 JavaScript 工具函数库,提供类型安全、Tree Shaking和良好的开发体验。

✨ 特性

  • 🚀 现代化构建 - 使用 tsdown 构建
  • 📦 Tree Shaking - 支持按需导入
  • 🔒 TypeScript - 完整的类型定义和智能提示
  • 🧪 完善测试 - 100% 测试覆盖率,包含性能基准测试
  • 📚 在线文档 - 完整的 API 文档和在线演示
  • 🎯 零依赖 - 无外部依赖,轻量级设计
  • 🌍 多格式 - 支持 ESM、CJS 和 TypeScript 声明文件

📦 安装

# npm
npm install @tofrankie/utils

# pnpm
pnpm add @tofrankie/utils

# yarn
yarn add @tofrankie/utils

🚀 快速开始

// ES Modules
import { debounce, throttle } from '@tofrankie/utils'
// CommonJS
const { debounce, throttle } = require('@tofrankie/utils')

📚 文档

🛠️ 开发

环境要求

  • Node.js >= 22.0.0
  • pnpm >= 10.15.1

安装依赖

# 启用 Corepack(首次使用)
corepack enable

# 或者手动激活指定版本的 pnpm
corepack prepare [email protected] --activate

# 安装依赖
pnpm install

开发命令

# 开发模式
pnpm dev

# 构建
pnpm build

# 测试
pnpm test

# 代码检查
pnpm lint

# 格式化
pnpm format

# 包体积分析
pnpm analyze

# 文档开发
pnpm docs:dev

项目结构

@tofrankie/utils/
├── src/                    # 源码
│   ├── function/          # 函数工具
│   └── index.ts           # 统一导出
├── dist/                  # 构建产物
├── test/                  # 测试文件
├── docs/                  # 文档站点
└── scripts/               # 构建脚本

🧪 测试

项目使用 Vitest 进行测试,包含单元测试和性能基准测试。

# 运行测试
pnpm test

# 运行基准测试
pnpm bench

# 测试覆盖率
pnpm test:coverage

🤝 贡献

欢迎贡献代码!请查看 贡献指南 了解详细信息。

📄 许可证

本项目基于 MIT 许可证 开源。

🙏 致谢

感谢所有为这个项目做出贡献的开发者!


注意: 本项目主要用于学习和演示现代化 JavaScript 工具库的开发流程。在生产环境中,建议使用经过充分测试的成熟工具库如 LodashRamda