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

dev-public-tool

v1.0.3

Published

Method lib

Downloads

6

Readme

Build Status npm npm Coverage Status

install

npm install element-ui -D

Method

  • dealPhone (str, pos, sty, styCount)

str:必 pos:必 sty:选 styCount:选

传两个参数:

手机号隐藏dealPhone ('18333335246', [0])

姓名隐藏dealPhone ('刘二狗', [1]) :刘**

传四个参数:

dealPhone('sdfslf', [2, 4],'-',8) :字符串、开始和结束的位置、代替样式、该样式出现的次数。
  • dealSort (val, type)

val:必 type:选


type : up 从小到大排序;

type : lower 从大到小排序;

type : split 分开整数和浮点数;
  • formChecked (str, type)

str:必 type:必

type: email
type: phone
type: tel
type: chinese
type: idCard
type: url
type: carNumber
  • getUrlParam(sVar)

sVar:必

截取路径上的参数值。
http://wwww.www.com?a=3&b=4
getUrlParam('a')  // 3
  • minMaxVal (arr, minMax, type)

arr:必 minMax:选 type:选

minMax :

默认返回最大值;

min 返回最小值;

type : all 有多个最大值时,返回所有出现过的值的位置;
  • pwdRange (str, arr, length)

str:必 arr: 必 length: 选

arr : 五种校验类型,按数组顺序校验,可以自己调位置把控顺序。
  length: 字符长度
  number: 是否含有数字
  upper: 是否有大写
  lower: 是否有小写
  special: 是否有特殊符号

length : 长度校验的长度默认6位。
  • randomNum (n1, n2)

n1:必 n2:选

传一个参数默认0 - n1 内的随机整数

传两个参数得到范围内的随机数整数
  • rmDuplicates (arr, property) 数组去重

arr:必 property:选

arr : 原数组或者是类数组
property : 可提供对象格式的数据的去重,根据属性名去重
  • toggleCase (str, type)

str: 必 type:必

type : word 将每个单词首字母大写;
type : paragraph 将每个段落的首字母大写;
  • trimSpace (str, type)

str: 必 type: 选

只有一个参数默认移除在字符串前后空格;
type : all 移除所有空格;
type : suffix 移除结尾的空格;
type : prefix 移除开始的空格;