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

zj-lishizhen

v0.0.21

Published

咱家健康前端框架-李时珍

Downloads

10

Readme

zj-lishizhen

咱家健康前端框架-李时珍(js常用代码库)

  • index.js 入口文件
  • common.js 公共方法代码
  • cookie 操作cookie代码
  • mobile.js 移动端相关代码
  • validate.js 公共验证规则代码

使用方法

import utils from 'zj-lishizhen'
utils.common.isPc()
utils.data.setData('userInfo', {name: '张三', age: 30})
utils.cookie.addCookie('a', 1)
utils.mobile.rem()
utils.validate.idCard()

安装

npm install

构建

npm run build

方法列表

common.js

  • jsGetAge 根据生日判断年龄,返回周岁
  • idCardNo 根据身份证号,获取生日、性别
  • getAbsoluteLocation 获取指定元素距离屏幕的距离
  • getQueryString 获取查询字符串的值
  • queryStringToObject 查询字符串转对象
  • objectToQueryString 对象转查询字符串
  • delQueryString 删除指定查询字符串的值 *
  • dateFtt 格式化时间函数
  • isForbid 检查是否含有非法字符
  • isIe 检测是否是IE浏览器
  • deepCopy 深度拷贝对象
  • deepMerge 深度合并对象
  • secToTime 秒数转时间字符串
  • timeToSec 时间字符串转为秒
  • typeOf 判断参数的数据类型
  • isWechat 判断是否是微信端
  • isPc 判断是否是PC端
  • print 打印指定区域内容
  • getScrollWidth 获取浏览器滚动条的宽度

cookie.js

  • addCookie 添加cookie
  • getCookie 获取cookie
  • delCookie 删除cookie

mobile.js

  • rem 计算页面rem
  • wechatReload 解决微信端无法使用window.location.reload()刷新页面的方法

validate.js

  • idCard 验证身份证号是否合法
  • phone 验证手机号是否合法
  • chinese 验证指定的内容是否都是中文
  • email 验证指定的内容是否是email地址
  • url 验证指定的内容是否是URL地址 - 地址必须以http/https/ftp/ftps开头
  • emoji 验证指定的内容是否包含emoji表情符