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 🙏

© 2026 – Pkg Stats / Ryan Hefner

jimi-web-public-tools

v0.2.2

Published

jimi-public

Readme

git

wiki

Installation

## Install globally or locally
$ npm i jimi-web-public-tools -S

Usage

ES6 module:

import { check } from 'jimi-web-public-tools'; // import check from 'jimi-web-public-tools/lib/utils/check';

// 手机号码校验
check.cellphone('13456789012'); // true

Script:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <script src="jimi-utils.min.js"></script>
</head>
<body>
  <script type="text/javascript">
    jimiUtils.check.cellphone('13456789012'); // true
  </script>
</body>
</html>

check

校验库

  • cellphone(value) 手机校验
  • telphone(value) 固定电话校验
  • phone(value) 电话【手机和固定电话】校验
  • email(value) 邮箱校验
  • postcode(value) 邮编校验
  • isNull(value) 空校验
  • isNumber(value) 数字校验
  • isInteger(value) 整数校验
  • isDecimal(value) 小数校验
  • hasChinese(value) 中文判断
  • idCard(value) 身份证校验
  • ip(value) ip地址校验
  • alipay(value) 支付宝账号校验
  • pwdIntensity(value) 弱密码校验

stringUtil

字符串操作

  • isNull(str) 空校验
  • isNumber(str) 数字校验
  • filterNull(str, [format='']) 空数据过滤
  • convertFenToYuan(str, [format='0.00']) 分转化成元
  • convertYuanToFen(str, [format='0']) 元转化为分

appUtil

app交互

  • isIos() 判断是否在IOS设备内
  • isAndroid() 判断是否在Android设备内
  • isWeChat() 判断是否在微信客户端内
  • isAliPay() 判断是否在支付宝客户端内
  • isJRApp() 判断是否在京东金融客户端内
  • isThirdApp() 判断是否在第三方合作App内
  • isQQ() 判断是否在QQ客户端内【非qq浏览器环境】
  • isPc() 判断是否在PC环境
  • inApp() 判断是否在机蜜App内
  • inOldApp() 判断是否在旧版本机蜜App内
  • getSceneType() 获取场景类型
  • jimiHandler(handler, param) 调用机蜜APP方法
  • jimiChangeTitle(title) 设置机蜜APP标题
  • jimiOpenNewWebView(url) H5打开机蜜APP新的webview
  • jimiRequestUserInfo(callback) 获取机蜜APP用户信息
  • jimiRequestUserInfoWithLogin(callback) 获取机蜜APP用户信息-未登录会调用登录页面
  • jimiSetUserLogin(userInfo) H5设置机蜜APP登录状态

common

调用方法

  • generateUUID() 生成uuid
  • getDeviceId([key]) 获取deviceId
  • getParameter(name, [url=window.location.search]) 获取url中的参数
  • loadScript(url, [callback]) 动态加载js
  • addURLParameter(url, paramName, paramVal) 向url中添加search参数
  • updateURLParameter(url, paramName, paramVal) 更新url中的search参数
  • removeURLParameter(url, paramName) 删除url中的search参数
  • getRepetition(key, ...targetArray) 获取多个对象数组的共同项

header

请求头

  • setPassword(value) 设置秘钥
  • setCommon(key, value) 设置公共请求参数
  • setCommons(params) 设置公共请求参数【批量】
  • getCommon(key) 获取公共请求参数
  • signature() 签名

crypt

加密解密【用于暴露在url中的重要参数】

  • encode(value) 加密
  • decode(value) 解密

floatUtil

浮点数运算【解决精度问题】

  • add(arg1, arg2, [format='']) 加法
  • subtract(arg1, arg2, [format='']) 减法
  • multiply(arg1, arg2, [format='']) 乘法
  • divide(arg1, arg2, [format='']) 除法