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

wzn-utils

v2.0.8

Published

> 目的:提高工作效率,少做一些无用功 *** 业务开发过程中,会经常用到数组去重、日期格式化、缓存数据等常用函数,为避免不同项目多次复制粘贴的麻烦,这里统一封装,并发布到npm,以提高开发效率。如果你也有常用的代码,欢迎为本项目提交pr。 *** ## 安装使用 > 1:使用npm安装 ## npm > npm install --save-dev wzn-utils > 使用 import utils from 'wzn=utils' ## API文档 *** ## Array

Downloads

6

Readme

projectUtils

前端业务常用代码工具库

目的:提高工作效率,少做一些无用功


业务开发过程中,会经常用到数组去重、日期格式化、缓存数据等常用函数,为避免不同项目多次复制粘贴的麻烦,这里统一封装,并发布到npm,以提高开发效率。如果你也有常用的代码,欢迎为本项目提交pr。


安装使用

1:使用npm安装

npm

npm install --save-dev wzn-utils 使用 import utils from 'wzn=utils'

API文档


Array

unique 数组去重 findValueInArray 从数据寻找某个值,如果有多个返回一个数组索引,如果没有,返回-1 deleteValue 删除数组中的对应值

object

equalValue 判断两个对象值是否相等

date

format 格式化日期 nyr 只显示日期的年月日 sfm 只显示日期的时分秒

math

add 两个数相加
sub 两个数相减 mul 两个数相乘 div 两个数相除 adds 多个数相加 subs 多个数相减
muls 多个数相乘
divs 多个数相除

regular 常用正则

email 邮箱正则

phone 手机号码正则

account 账户用户名正则

password 密码正则

idCard 身份证正则

bankCard 银行卡正则

other 其它常用函数

formatMoney 金额格式化 formatPhone 手机脱敏