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

baiee-lib

v1.0.5

Published

描述:h5项目中一些常用的方法封装

Readme

项目基础类库封装

描述:h5项目中一些常用的方法封装


baieeUtil

check主要用于检验浏览器的类型
baieeUtil.check.isIE()
baieeUtil.check.isIE9()
baieeUtil.check.isEdge()
baieeUtil.check.isChrome()
baieeUtil.check.isFF()
baieeUtil.check.isIos()
baieeUtil.check.isAndroid()
baieeUtil.check.isWx()
baieeUtil.check.isUc()
baieeUtil.check.isByb()

send主要用于与客户端交互

    /**
     * 将信息推送到客户端的方法
     * @param {String} funName 客户端定义方法名
     * @param {any} params 需要传递参数
     * @param {String} objName 安卓暴露对象
     */
    baieeUtil.send.sendInfo(funName, params, objName)  

img 主要用于图片预处理

    /**
     * 处理并返回图片路径
     * @param {*} imgUrl 后端返回路径
     * @param {*} imgDomain 文件服务域名
     * @param {*} defaultImgUrl 默认图片
     */
    baieeUtil.img.handleUrl (imgUrl, imgDomain, defaultImgUrl) 

datautil 主要用于后端返回数据预处理

    /**
     * 预处理后端返回消息实体
     * @param {*} data 消息实体
     */
    baieeUtil.datautil.handleReqData (data)

localstorage 主要用于存储前端相关数据 涉及跨域跳转后返回

    /**
     * 设置缓存信息
     * @param {*} key 键值
     * @param {*} value 内容
     */
    baieeUtil.localstorage.setItem(key, value) 

    /**
     * 获取数据
     * @param {*} key 
     */
    baieeUtil.localstorage.getItem(key)

    /**
     * 删除某项数据
     * @param {*} key 键值
     */
    baieeUtil.localstorage.remove(key)

    /**
     * 清空缓存
     */
    baieeUtil.localstorage.clear()

sessionstorage 主要用于存储前端相关数据 不涉及跨域跳转后返回

    /**
     * 设置缓存信息
     * @param {*} key 键值
     * @param {*} value 内容
     */
    baieeUtil.sessionstorage.setItem(key, value) 

    /**
     * 获取数据
     * @param {*} key 
     */
    baieeUtil.sessionstorage.getItem(key)

    /**
     * 删除某项数据
     * @param {*} key 键值
     */
    baieeUtil.sessionstorage.remove(key)

    /**
     * 清空缓存
     */
    baieeUtil.sessionstorage.clear()

dateUtil 时间戳处理类

    // 将时间字符串转化为时间戳 str格式 yyyy-MM-dd hh:mm:ss||yyyy/MM/dd hh:mm:ss
    baieeUtil.dateUtil.unixTime(str)
    // 将时间戳转换为字符串 unixTime时间戳 fmt转换格式 yyyy-MM-dd hh:mm:ss || yyyy/MM/dd hh:mm:ss || yyyy年MM月dd日hh时mm分ss秒 等皆可
    baieeUtil.dateUtil.fromUnixTime(unixTime, fmt)