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

font_common_tool

v1.0.11

Published

`npm install font_common_tool` 或者 `yarn add font_common_tool`

Readme

使用说明

安装

npm install font_common_tool 或者 yarn add font_common_tool

使用

import fct from "font_common_tool"

fct.isEmail("xxxx") //false

API

常见数据格式校验

  • 邮箱校验 fct.isEmail(str) 返回 ture/false
  • 手机号校验 fct.isMobile(str) 返回 ture/false
  • 电话号码 (座机)校验 fct.isPhone(str) 返回 ture/false
  • url 地址校验 fct.isURL(str) 返回 ture/false
  • 银行卡号校验 fct.isBankCardNo(str) 返回 ture/false
  • 身份证号校验 fct.isIdCardNo(str) 返回 ture/false

常见数据类型校验

  • 是否字符串 fct.isString(str) 返回 ture/false
  • 是否数字 fct.isNumber(str) 返回 ture/false
  • 是否布尔值 fct.isBoolean(str) 返回 ture/false
  • 是否函数 fct.isFunction(str) 返回 ture/false
  • 是否 null fct.isNull(str) 返回 ture/false
  • 是否 underfined fct.isUndefined(str) 返回 ture/false
  • 是否对象 fct.isObj(str) 返回 ture/false
  • 是否数组 fct.isArray(str) 返回 ture/false
  • 是否时间 fct.isDate(str) 返回 ture/false
  • 是否正则 fct.isRegExp(str) 返回 ture/false
  • 是否错误对象 fct.isError(str) 返回 ture/false
  • 是否 Symbol 函数 fct.isSymbol(str) 返回 ture/false
  • 是否 Promise 对象 fct.isPromise(str) 返回 ture/false
  • 是否 Set 对象 fct.isSet(str) 返回 ture/false

element 类名操作

  • 是否包含某个类名 fct.hasClass(el,className) 返回 ture/false
  • 添加类名 fct.addClass(el,className)
  • 删除类名 fct.removeClass(el,className)

系统/环境相关

  • 是否微信浏览器 fct.isWeiXin() 返回 ture/false
  • 是否移动端 fct.isDeviceMobile() 返回 ture/false
  • 是否QQ浏览器 fct.isQQBrowser() 返回 ture/false
  • 是否IOS fct.isIos() 返回 ture/false
  • 是否PC端 fct.isPC() 返回 ture/false

其他常用工具

  • 去除html标签 fct.removeHtmltag(str) 返回str
  • 获取url参数 fct.getQueryString(str) 返回str
  • 动态引入js fct.injectScript(src)
  • 根据url下载 fct.download(url)
  • 回到页面顶部 fct.scrollToTop()
  • 滚动到指定元素位置 fct.scrollToElm(className,add,del) add,del为加减偏移量
  • 将阿拉伯数字翻译成中文的大写数字 fct.numberToChinese(num) 返回str
  • 节流 fct.throttle(func,delay)
  • 防抖 fct.debounce(func,delay)
  • 16进制颜色赚RGBA fct.colorToRGB(val, opa) opa为透明度 返回str
  • 复制文本 fct.copyText(str)
  • 去除空格 fct.trim(str,type) type: 1-所有空格 2-前后空格 3-前空格 4-后空格 返回str
  • 数字千分位,分隔 fct.thousands(num) 返回str

持续更新.....

如遇问题联系邮箱 [email protected]