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 🙏

© 2024 – Pkg Stats / Ryan Hefner

rl-global-js

v1.0.5

Published

常用验证和常用方法

Downloads

2

Readme

// 安装npm i rl-global-js // 使用 import {validate,global} from 'rl-global-js'

validate={ // 字符串 isString(params) // 对象 isObject(params) // 数组 isArray(params) // 数字 isNumber(params) // boolean isBoolean(params) // null isNull(params) // undefined isUndefined(params) // date isDate(params) // 手机号 isPhone(params) // 字母 isLetter(params) // 用户名 4到16位(字母,数字,下划线,减号) isUsername(params) // 帐号(字母开头,允许5-16字节,允许字母数字下划线) isAccount(params) // 密码强度正则,最少6位,包括至少1个大写字母,1个小写字母,1个数字,1个特殊字符 isPassword(params) //正整数正则 isPint(params) //负整数正则 isNint(params) //整数正则 isInt(params) //正数正则/正浮点数 isPnumber(params) //负数正则/父浮点数 isNnumber(params) // 邮箱 isEmail(params) // 身份证 isCard(params) // URL isUrl(params) // IP isIp(params) // 中文 isChinese(params) } global={ / * 异常抛出 * @param {*必传} file:异常地址 * @param {*必传} event:事件 * @param {*必传} msg:错误描述 */ winError(file,event,msg) / * 路径 * @param {*必传} params */ apiPath(params) / * 日期比较 * 第一个日期大于第二个日期为true * @param {*必传} date * @param {*非必传} compareDate */ dateCompare(date,compareDate) / * 获取日期 * @param {*非必传} date * @param {*非必传} format */ getDate(date=new Date(),format) / * 设置session缓存 * @param {*必传} key * @param {*非必传} data */ setSession(key,data) / * 获取session缓存 * @param {*必传} key */ getSession(key) / * 删除session缓存 * @param {*非必传} key */ delSession(key) / * 设置local缓存 * @param {必传} key * @param {} data */ setLocal(key,data) / * 获取local缓存 * @param {*必传} key */ getLocal(key) / * 删除local缓存 * @param {*非必传} key */ delLocal(key) / * 数组排序 * @param {*必传} data:type==array * @param {*必传} params:排序参数 * @param {*非必传} type:默认正序,type==down倒序 */ arraySort(data,params,type) / * 数组去重 * @param {*必传} data * @param {*必传} params */ arrayRepetition(data,params) }