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

xrk-tools-test

v1.0.20

Published

平台通用工具

Readme

Constants

base

通用基础方法

Kind: global constant

base.numberFormat(num, divisor, decimalPlaces, unit)

格式化数值

Kind: static method of base

base.easyDeepClone(content)

简易深克隆(无法克隆Function Map Set undefined)

Kind: static method of base

base.deepClone(content)

深克隆

Kind: static method of base

check

数据检查

Kind: global constant

check.isNumber(num)

判断是否为数字 (数字字符串也是数字,例如'23'、'123.213')

Kind: static method of check

check.isTel(tel)

判断是否为手机号

Kind: static method of check

check.isFalseValue(value)

判断是否有值,但是值为false

Kind: static method of check

check.isFunction(param)

判断是否为函数

Kind: static method of check

check.isDate(param)

判断是否为时间对象

Kind: static method of check

check.isObject(param)

判断是否为Object对象

Kind: static method of check

check.isMap(param)

判断是否为Map

Kind: static method of check

check.isSet(param)

判断是否为Set

Kind: static method of check

check.isString(param)

判断是否为字符串

Kind: static method of check

check.isBoolean(param)

判断是否为Boolean

Kind: static method of check

date

处理时间

Kind: global constant

date.dateFormat(date, fmt, autoFillZero)

格式化时间

Kind: static method of date

file

处理文件

Kind: global constant

file.dataURLToBlob(base64)

base64转为Blob

Kind: static method of file

file.blobToDataURI(blob)

Blob转为base64

Kind: static method of file

file.imgElement2Base64(imgElement)

将img标签转为base64

Kind: static method of file

file.imgUrl2Base64(imgUrl)

将img网络资源转为base64

Kind: static method of file

file.getNetFile(url, responseType, options)

获取网络资源文件

Kind: static method of file

file.contentToQrcodeUrl(content)

将内容转为二维码图片

Kind: static method of file

money

处理金额

Kind: global constant

money.moneyFixed(num, decimalPlaces, unit)

将分格式化为元,保留两位小数

Kind: static method of money

money.moneyComplete(num)

将元格式化为分,主要用于向服务端传递参数时使用

Kind: static method of money

money.afterTaxPrice(num, tax)

给c端计算税率

Kind: static method of money

customStorage

处理本地数据

Kind: global constant

customStorage.setStorage(key, value, isLocal)

本地数据存储

Kind: static method of customStorage

customStorage.getStorage(key, isLocal)

读取本地存储的数据

Kind: static method of customStorage

transform

处理字符串

Kind: global constant

transform.hideSomeString(str, start, end, replaceStr)

将字符串指定位置替换为指定字符

Kind: static method of transform