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

ucc-utils

v0.4.0

Published

Ucc工具库

Readme

UCC-Utils

npm version License

一个现代化的 JavaScript/TypeScript 工具库,提供了丰富的实用工具函数和组件。

特性

  • 🚀 完整的 TypeScript 支持
  • 📦 模块化设计,支持按需引入
  • 🔧 同时支持浏览器和 Node.js 环境
  • 🎯 零依赖核心功能
  • 🔄 支持 ESM 和 CommonJS 两种模块规范

安装

# npm
npm install ucc-utils

# yarn
yarn add ucc-utils

# pnpm
pnpm add ucc-utils

依赖说明

核心依赖

npm install axios lodash

可选依赖

根据需要使用的功能安装相应的依赖:

# Vue 相关功能
npm install vue

# Cesium 相关功能
npm install cesium

# Redis 相关功能(仅服务端)
npm install redis

功能模块

浏览器端模块

  • Core 核心工具

    • 基础工具函数
    • 类型判断
    • 性能优化
    • 异常处理
    • 正则表达式工具
  • DOM 操作

    • DOM 元素操作
    • 事件处理
    • 虚拟 DOM 工具
  • Request

    • HTTP 请求封装
    • 请求拦截器
    • 响应处理
  • Storage

    • LocalStorage 封装
    • SessionStorage 封装
    • IndexedDB 工具
  • Worker

    • Web Worker 工具
    • 多线程处理

通用模块(浏览器/服务端)

  • SQL

    • 数据库查询构建
    • 数据库操作工具
  • Socket

    • WebSocket 客户端
    • WebSocket 服务端
    • 实时通信工具

可选功能模块

  • Vue 相关(需要 vue)

    • Hooks
    • 组件
    • 工具函数
  • Cesium 相关(需要 cesium)

    • 地图工具
    • 3D 渲染
  • Redis(仅服务端,需要 redis)

    • Redis 客户端封装
    • 缓存管理

使用示例

浏览器端功能

// 核心功能
import { core, dom, request, storage, worker } from 'ucc-utils';
// 或按需导入
import { core } from 'ucc-utils/core';
import { dom } from 'ucc-utils/dom';

通用功能

// 可在浏览器和服务端使用
import { sql, socket } from 'ucc-utils';
// 或按需导入
import { sql } from 'ucc-utils/sql';
import { socket } from 'ucc-utils/socket';

可选功能

// Vue 相关(需要安装 vue)
import { hooks } from 'ucc-utils/hooks';
import { components } from 'ucc-utils/vue';

// Cesium 相关(需要安装 cesium)
import { cesium } from 'ucc-utils/cesium';

// Redis(仅服务端,需要安装 redis)
import { Redis } from 'ucc-utils/storage/redis';

示例

使用核心工具函数

import { core } from 'ucc-utils';

// 类型判断
core.isArray([1, 2, 3]); // true
core.isObject({}); // true

// 性能优化
const debouncedFn = core.debounce(() => {
  // 你的代码
}, 300);

使用 DOM 操作

import { dom } from 'ucc-utils';

// 元素选择
const element = dom.querySelector('#app');

// 事件处理
dom.addEvent(element, 'click', (e) => {
  // 处理点击事件
});

使用 Hooks

import { useNextId } from 'ucc-utils/hooks';

// 在 Vue 组件中
const id = useNextId();

API 文档

详细的 API 文档请访问:API Documentation

浏览器兼容性

  • 现代浏览器 (Chrome, Firefox, Safari, Edge)
  • 不支持 IE

贡献指南

  1. Fork 本仓库
  2. 创建特性分支 (git checkout -b feature/AmazingFeature)
  3. 提交改动 (git commit -m 'Add some AmazingFeature')
  4. 推送到分支 (git push origin feature/AmazingFeature)
  5. 提交 Pull Request

开发

# 安装依赖
pnpm install

# 开发模式
pnpm dev

# 构建
pnpm build

# 运行测试
pnpm test

许可证

MIT © Yuluo