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 🙏

© 2025 – Pkg Stats / Ryan Hefner

yangtesthahahaha

v1.0.25

Published

test

Readme

函数返回

返回形式

每个函数返回的是一个对象:

{
    result: bool,
    code: code
}

result返回的一个布尔值,表示结果是否符合
code返回的是一个数字,表示返回的代号。

code

通用code

100:表示所给的字符符合标准
101:表示所给的字符为空,即未输入
103:表示所给的字符不和标准格式

独有code

2开头的code:密码的独有code
3开头的code:身份证的独有code
4开头的code:社会信用号的独有code
5开头的code:组织的独有code
6开头的code:工商注册号的独有code
7开头的code:纳税人的独有code
8开头的code:邮寄地址的独有code

文件

文件构成

index.js:引用src里面的各函数
src:存放验证文件
package.json:基本信息
README.md:文件说明

src文件夹

username.js

1.函数名:isUserName
2.作用:验证用户名
3.参数:str
4.所定标准:长度为1-40的中文名或英文名

password.js

1.函数名:isPassword
2.作用:验证密码
3.参数:str
4.所定标准:密码长度在6-32内,且必须同时包含两种不同的字符
5.独有code:
201:密码长度在6-32位外或包含有空格符号
202:密码不能全为数字或字母
203:密码不能全为特殊符号

email.js

1.函数名:isEmail
2.作用:验证邮箱是否合法
3.参数:str
4.所定标准:用户名@域名

phone.js

1.函数名:isPhone
2.作用:验证手机号
3.参数:str
4.所定标准:开头为1314151718的11为的数字

idCard.js

1.函数名:isIDCard
2.作用:验证身份证号
3.参数:str
4.所定标准:符合正确身份证号的标准
5.独有code:
301:地址编码错误
302:校验位错误

portCode.js

1.函数名:passPortCode
2.作用:验证护照号
3.参数: str
4.所定标准:符合正确护照的标准

bank.js

1.函数名:isBankCodepublicBankCode
2.作用:
isBankCode:验证银行卡号;
publicBankCode :验证对公银行账号
3.参数:都是str
4.所定标准:
银行卡号(isBankCode):符合正确银行卡号格式
对公银行账号(publicBankCode):9-21位的数字

address.js

1.函数名:address
2.作用:验证邮寄地址
3.参数:str
4.所定标准:长度为6-50,且不能包含数字或特殊字符
5.独有code:
801: 邮寄地址长度超过50位
802: 邮寄地址长度小于6位
803: 邮寄地址包含特殊字符
804: 邮寄地址全为数字

creditCode.js

1.函数名:isCreditCode
2.作用:验证社会信用号
3.参数:str
4.所定标准:符合正确社会信用号的标准
5.独有code:
401:社会信用代号长度必须为18位
402:包含非法字符
403:校验码错误

businessRegistrationCode.js

1.函数名:businessRegistrationCode
2.作用:验证工商注册号
3.参数:str
4.所定标准:符合正确工商注册号的标准
5.独有code:
601:注册号长度为15位
602:工商注册号错误

organization.js

1.函数名:checkOrganizationNamecheckOrganizationCode
2.作用:
checkOrganizationName:验证组织名称
checkOrganizationName :验证组织机构代码
3.参数:都是str
4.所定标准:
组织名称(checkOrganizationName):2-50个中文或英文的字符且不包含空格
组织机构代码(checkOrganizationName):符合规定的组织机构代码格式
5.独有code:
501:组织名称不在2-50个中文或英文的范围内,或包含空格
503:校验不通过,请参照证件上的填写,10位或者9位,支持填写格式示例:12345678-9 或者 123456789

tax.js

1.函数名:taxNametaxNaID
2.作用:
taxName:验证纳税人名
taxID:验证纳税人识别号
3.参数:都是str
4.所定标准:
纳税人名(taxName):长度在1-50的中文名
纳税人识别号(taxID):长度为15、18或20位的数字,且不包含空格
5.独有code: 701: 纳税人名长度不在1-50内
702: 纳税人名不是中文 703: 纳税人识别号不为为15、18或20位的数字,或包含空格