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

webnian

v1.0.16

Published

- [webnian中文文档](http://webutf.com/sec/webutf) >欢迎访问webnian中文文档

Downloads

29

Readme

##for more information

欢迎访问webnian中文文档

Install

<script src="./webutf.js"></script>
<script>
  utils.isName('xxx')
  utils.isMobile('xxx')
  ...
</script>

Install

var utils = require('webutf')

utils.isName('xxx')
utils.isMobile('xxx')
...

##Getting started ##utils下的方法及参数:

  • isName('xxx') // 判断是不是姓名
  • isChinese('xxx') // 判断是不是中文
  • isMobile('xxx') // 判断是不是手机号
  • isIdNum(idNum) //判断是不是身份证号
  • isEmail(str) //判断是不是邮箱
  • getUrlQueryString(url) // 获取URL上传的参数
  • copyObject(obj) // 深拷贝对象
  • linkTo(url) // 连接到某个网址
  • download(url) // 下载相关
  • toDouble(n) // 单位数转2位数
  • getBirthdayById(idNum) // 通过身份证获取生日
  • getGenderById(idNum) // 通过身份证获取性别
  • birthDayAge(birth) // 通过年月日获得年龄
  • mix(obj1, obj2) // 合并2个对象
  • cleanHtml(html) //将HTML标签净化为纯文本
  • random(str, end) // 获取一个范围内的随机数
  • date(date, ['yyyy-MM-dd hh:mm:ss']) // 毫秒数转年月日,时分秒
  • filterNumber(str) // 过滤字符串返回纯数字
  • scroll() // 获取滚动元素的滚动距离
  • getStyle(ele, attr) // 获取样式
  • setCookie({name, value, expires, path, domain, secure}) // 设置cookie,传入一个对象
  • getCookie(name) // 获取cookie
  • removeCookie(name) // 删除cookie
  • scrollUnique: scrollUnique, // 子级元素滚动不影响父级
  • querySelector: querySelector, // dom缓存
  • arrayEqual: arrayEqual, // 判断2个数组是否绝对相等
  • ajax: ajax,
  • hasClass: hasClass, // 判断元素是否有某个class样式
  • addClass: addClass, // 向某个元素添加class样式
  • removeClass: removeClass, // 删除元素class样式
  • offset: offset, // 获取一个元素的距离文档(document)的位置,类似jQ中的offset()
  • requestFullscreen: requestFullscreen, // 全屏
  • fullScreenStatus: fullScreenStatus, // 判断是否全屏
  • cancelFullScreen: cancelFullScreen, // 退出全屏
  • onFullScreenEvent: onFullScreenEvent, // 全屏事件回调
  • camelCase: camelCase, //将一组字符串变成“骆驼”命名法的新字符串,如果该字符已经是“骆驼”命名法,则不变化。
  • contains: contains,
  • isArray: isArray,
  • isNumeric: isNumeric,
  • isFunction: isFunction,
  • isWindow: isWindow,
  • isDocument: isDocument,
  • isObject: isObject,
  • isPlainObject: isPlainObject,
  • getUrlData: getUrlData, //get请求传给后台的数据
  • animationend: animationend, //返回animationend事件
  • compact: compact, //创建一个新数组,包含原数组中所有的非假值元素。如false, null, 0, "", undefined, 和 NaN 都是假值
  • endsWith: endsWith,
  • escapeHTML: escapeHTML, //Hello world!
  • isInWeixinApp: isInWeixinApp, //判断是不是微信app环境
  • loadScript: loadScript, //加载js
  • loadStyles: loadStyles, //加载css
  • repeat: repeat, //字符串重复n次
  • startsWith: startsWith,
  • transitionend: transitionend, //返回transitionend事件
  • windowTop: windowTop, //将top对象的网址自动导向被嵌入网页的网址