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

pluginunit

v1.3.3

Published

[![pluginunit](https://img.shields.io/npm/v/pluginunit.svg)](https://npmjs.org/package/pluginunit) [![NPM all downloads](https://img.shields.io/npm/dt/pluginunit.svg?style=flat-square)](https://npmjs.org/package/pluginunit) [![NPM downloads](https://img

Downloads

67

Readme

GITHUB地址| 插件地址

pluginunit NPM all downloads NPM downloads NPM downloads

框架引用 npm install pluginunit --save
import pluginunit from 'pluginunit' 分类api 汇总 |算法相关 | 缓存操作 | 数据操作 | 节点操作 | 时间操作 | 正则操作

  • fewCurrent(data) 时间:data=格式遵守new Date格式即可 可以时间戳。识别当前月或者几个月前 超过十二个月自动识别几年前

  • getTime(data) 时间:data=格式遵守new Date格式即可 可以时间戳。年月日时分秒

  • getTimes(data) 时间:data=格式遵守new Date格式即可 可以时间戳。 年月日

  • numAdd(num1, num2) 加法运算 千位符都可以计算

  • numMulti(num1, num2) 乘法运算 千位符都可以计算

  • numDivision(num1, num2) 除法运算 千位符都可以计算 num1除数,num2被除数

  • // 请求 ajax({type: "get", url: url,data: data,dataType: "json",success: function (result) {} });

  • DX(event) 大写金额

  • setCookie(cname, cvalue, exdays) 设置cookie cname名字 cvalue值

  • getCookie(cname) 获取cookie

  • clearCookie(cname) 清除cookie

  • clearCookieAll() 清除全部cookie

  • setLocalStorage(name, val) 设置LocalStorage name名字 val值

  • getLocalStorage(cname) 获取LocalStorage

  • clearLocalStorage(cname) 清除LocalStorage

  • clearLocalStorageAll() 清除全部LocalStorage

  • setSessionStorage(name, val) 设置sessionStorage name名字 val值

  • getSessionStorage(cname) 获取sessionStorage

  • clearSessionStorage(cname) 清除sessionStorage

  • clearSessionStorageAll() 清除全部sessionStorage

  • postObj(a) 数组对象转化json字符串

  • strturn(a) 字符串逆转

  • GetFileExt(filepath) 取文件后缀名

  • GetFileName(filepath) 取文件全名名称

  • GetFileNameNoExt(filepath) 取文件名不带后缀

  • housandDigits(a) 千位符

  • hyreplace(data, original, originals, manyTimes = false) 替换或全部 data需要替换的数据 original替换内容 originals被替换内容

  • unique(a) 记录数组重复值和位置

  • dt(drag) 拖动 输入id

  • numSub(num1, num2) 減法运算 千位符都可以计算 num1-num2

  • duplicateRemovalSet(data,a=0) 数组去重排序 第二个值1的时候是降序

  • arrayValueSort(data, value) 数组的属性排序大小 data数组 value属性

  • deepCopy(Obj) 深拷贝

  • hasClass(primary, cls) primary原本的class ,cls是否有这个 有class==true 没有返回false

  • addClass(primary, cls) primary:原本的class, class添加的class true 成功添加

  • addClass(primary, cls) primary:原本的class, class删除的class

  • filterTree(arryData) 数组变成树形 arryData数组 父亲pid 自己id

  • findId(arry, 1) 递归找某节点 arry树形,1查找id

  • getStrBirthday(date) 根据生日获取年龄 可以时间戳 时间2018-01-02 ()

  • timeFormats(data, type,force) 返回控制代表时间戳 //type=0 2019年02月23 周六 18: 55 type=1 2019年02月23 周六 同年不显示年强制需要年force=1timeFormats(1554973494,0,1)

  • slideTop(id, time = 0)滑动到指定id元素 id:元素id time滚动时间 默认没有停顿

  • scrollTop(number = 0, time)滑动距离 基于body滚动 number:滚动距离 time滚动时间

  • getUrlByName(name, url)获取url?参数值 name:需要获取的对应值名字 url:选填,不填就获取当前地址

  • parseUrl(url)url?参数转化为对象 url:选填,不填就获取当前地址 cardToBirthday(data) 身份证转生日 格式19950-05-08

  • staArrNum(data) 统计每个元素出现的次数 var a=[1,1,2]; {'1':2,'2':1}

  • phoneNumberVerification(data) 手机号码验证 true false

  • passwordStrength(data, type = false) 密码强度正则,最少6位 type=false 默认值 包括至少1个大写字母,1个小写字母,1个数字 type=true包括至少1个大写字母,1个小写字母,1个数字,1个特殊字符,

  • emailVerification(data) email验证 true false

  • urlVerification(data) 地址验证 true false

  • chineseCharacters(data) 中文+字符验证 true false

  • chineseVerification(data) 中文验证 true false

  • phoneStart(data) 手机号码中间星星 134*****290