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

comfunc

v1.0.5

Published

函数库

Readme

这是一个公共的测试函数库

用法:

npm install comfunc

import _ from 'comfunc'

既可以使用相应的包

api 文档

checkType 检测字符串类型

eg: _.checkType(str , type) ===> Boolearn

type

| str | type | | ------ | ---------------- | | .... | email | 邮箱 | .... | idCard | 身份证 | .... | date_ | 2010-01-01 | .... | date/ | 2010/10/10 | .... | phone | 手机号 | .... | english | 英文 | .... | chinese | 中文 | .... | number | 数字

checkPwdStrength 检查密码强度

eg: _.checkPwdStrength(str) ===> Number(0,1,2,3,4)

0 小于 6位数 1 大于 6位数 数字或大小写或特殊符号 中 1 个 2 大于 6位数 数字或大小写或特殊符号 中 2 个 3 大于 6位数 数字或大小写或特殊符号 中 3 个 4 大于 6位数 数字或大小写或特殊符号 中 4 个

digitUppercase 数字转换金额

eg: _.digitUppercase(1111) ===> 壹仟壹佰壹拾壹

trim 去掉空格

eg: _.digitUppercase(str , type) ====> string

type 1-所有空格 2-前后空格 3-前空格 4-后空格

isValid 判断是否是有用信息

eg: _.isValid(str) ====> Boolearn

isJustify 判端对象,数组

数组 eg: _.isJustify.isArr() ===> bool

对象 eg: _.isJustify.isObj() ===> bool

deepClone 深度克隆

eg: _.deepClone(obj) ===> obj

distinct 数组去重

eg: _.distinct(arr) ===> new arr

unique 数组子对象属性去重

eg: _.unique(arr) ===> new arr


download 下载文件

eg: _.download(url)

_.download('www.baidu.com')

downExcel 下载文件

eg: _.downExcel(jsonData,str,name)

var jsonData = [{name:'wc',age:'12',sex:'男'},{name:'cw',age:'13',sex:'女'}], str = '姓名,年龄,性别', name = '下载的名称'

_.downExcel(jsonData,str,name)