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

@moneko/common

v1.12.1

Published

common

Downloads

327

Readme

@moneko/common

🐾 🐾 🐾 🐾

这是一个通用 JavaScript/TypeScript 工具集

docs-ui

version install size download x

GitHub Actions CI

@moneko/common

安装

npm install @moneko/common -S
# or
yarn add @moneko/common -S
# or
pnpm add @moneko/common -S

按需引入

@moneko/common 默认支持基于 ES modules 的 tree shaking,直接引入即可获得按需加载效果:

import { cloneDeep, uuid } from '@moneko/common';

API 参考

| 函数 | 说明 | 版本 | | :------------------- | :----------------------------------------------------------------- | -----: | | cloneDeep | 深拷贝 | - | | cmykToHsv | 将 CMYK 转换为 HSV | - | | colorParse | 将表示颜色的字符串解析为 HSV 数组, 通过 toString()方法获取字符串值 | - | | decodeText | 解码文本 | 1.9.0 | | digest | 摘要算法 | 1.8.0 | | downloadBlob | 下载 Blob 对象 | - | | encodeText | 编码文本 | 1.9.0 | | entityToString | 实体转换为字符串 | - | | filterArrayByKeyword | 根据关键词过滤数组元素 | 1.11.0 | | frameCallback | 帧回调 | - | | fullscreen | 全屏操作 | - | | getClientSize | 获取客户端尺寸 | - | | getColorContrast | 获取颜色对比度 | - | | getDataType | 获取数据类型 | - | | getMaxZindex | 获取最大 z-index 值 | - | | getPrefixCls | 获取类名前缀 | - | | getScrollTop | 获取滚动位置 | - | | hexToHsv | 将 HEX 转换为 HSV | - | | hslToHsv | 将 HSL 转换为 HSV | - | | hsvaToString | 将 HSVA 转换为字符串 | - | | hsvToCmyk | 将 HSV 转换为 CMYK | - | | hsvToHex | 将 HSV 转换为 HEX | - | | hsvToHsl | 将 HSV 转换为 HSL | - | | hsvToRgb | 将 HSV 转换为 RGB | - | | isColor | 判断是否为颜色值 | - | | isElementInside | 判断元素是否在容器内部 | - | | isEqual | 判断两个值是否相等 | - | | isFunction | 判断是否为函数 | - | | isObject | 判断是否为对象 | - | | isProxy | 判断是否为代理对象 | - | | isString | 判断是否为字符串 | - | | isSvgElement | 判断是否为 SVG 元素 | - | | isUint8Array | 判断是否为 Uint8Array | - | | isUndefined | 判断是否为 undefined | - | | md5 | MD5 哈希算法 | 1.9.0 | | mixColor | 混合颜色 | - | | onLCP | 监听最大内容绘制 | - | | passiveSupported | 判断是否支持被动事件监听器 | - | | persistence | 数据持久化 | - | | printBanner | 打印横幅 | - | | printPicture | 打印图片 | 1.12.0 | | rgbToHex | 将 RGB 转换为 HEX | - | | rgbToHsv | 将 RGB 转换为 HSV | - | | setClipboard | 设置剪贴板内容 | - | | stringToBase64Url | 将字符串转换为 Base64 URL | - | | textBounding | 获取文本边界 | - | | throttle | 节流函数 | - | | toneColor | 色调颜色 | - | | updateStyleRule | 更新样式规则 | - | | uuid | 生成 UUID | - | | watermark | 水印功能 | - |