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

cc-frontend-utils

v0.4.8

Published

cc-frontend-utils: zero-dependency JavaScript utilities (tree, debounce, throttle, storage, query, date, deepClone).

Readme

cc-frontend-utils

一套零依赖的 JavaScript 工具函数库,提供 toTreefindTargetFromTreedebouncethrottledeepClonestoragebuildQueryparseQueryformatDatenativeWin,以及若干浏览器 / Node 端辅助函数。

注:0.4.5 是使用 vue-cli-service build --target lib --name cc-frontend-utils 打包的最后一个版本;0.4.6+ 改用 Vite 输出纯净的 ESM/CJS 包,0.4.8+ 拆出 cc-frontend-utils/node 子入口提供 Node 专用工具。

安装

npm install cc-frontend-utils

使用(浏览器 / 同构)

// ES module
import { toTree, debounce, copyClip } from 'cc-frontend-utils';

// CommonJS
const { toTree, debounce, copyClip } = require('cc-frontend-utils');

使用(Node 专用)

Node 端工具通过 cc-frontend-utils/node 子入口导入,避免把 node: 内置模块挤进浏览器 bundle:

import { success, error, md5, mkdirsSync, sendMail } from 'cc-frontend-utils/node';

其中 sendMail 不再硬依赖 nodemailer,调用方传 transport 即可:

import nodemailer from 'nodemailer';
import { sendMail } from 'cc-frontend-utils/node';

const transport = nodemailer.createTransport({ host: '...' });
await sendMail({ transport, from: 'me@x', to: 'you@y', subject: 'hi', html: '<p>hi</p>' });

每个导出函数在发布的包里还有 Markdown 文档,位于 cc-frontend-utils/docs/,完整入口见 docs/index.md

API 概览

通用(cc-frontend-utils

| 模块 | 导出 | | --- | --- | | tree | toTreefindTargetFromTree | | function | debouncethrottle | | object | deepClone | | object-extra | arr2objgetDataByKeysgetValue | | storage | storage | | url | buildQueryparseQuery | | url-builder | buildUrl | | date | formatDate | | browser | nativeWinutils | | clipboard | copyClip | | cookie | getCookie | | random | generateMixed | | array | unique | | legacy/date-legacy | timestampToTimetimeToStringstringToTime | | legacy/url-legacy | obj2String |

Node 专用(cc-frontend-utils/node

| 模块 | 导出 | | --- | --- | | result | successerrornotLogin | | crypto-hash | md5hash | | random | generateMixed | | order-param | orderParam | | chinese-truncate | subChinaString | | fs-utils | mkdirsSync | | mail | sendMail(依赖由调用方注入,无需 nodemailer) |

构建

npm run build 会依次执行 vite build && node scripts/postbuild.js && node scripts/gendocs.mjs,生成 dist/(双入口 ESM/CJS + .d.ts)以及 dist/docs/ 下每个模块对应的 Markdown API 参考。

许可

MIT