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

mobile-tool

v1.0.7

Published

一款基于移动端而生的迷你库

Readme

引用js

方法:

  1. 判断是否为手机 Mobile.isMobile()

  2. 判断是否在微信 Mobile.isWeixin()

  3. 判断是否为Android系统 Mobile.isAndroid()

  4. 判断是否为Ios系统 Mobile.isIos()

  5. 判断是否为UC 1.0.6移除

  1. 判断是否为UC极速模式 1.0.6移除
  1. 最近浏览(已移除) 1.0.3 移除

记录cookie,依次存名字为name1、name2、…… 、name+count的cookie name: 记录的cookie名 str: 记录的数据 count: 最近访问允许的最大长度

<pre>Mobile.getViewCookie(name)</pre>				返回记录多少个 name+count 的cookie
  1. 添加cookie,名、值、过期时间 1.0.3 移除
  1. 获取cookie 1.0.6移除
  1. 删除cookie 1.0.6移除
  1. 改变地址栏参数:如果地址栏有对应参数,改变参数值并跳转,如果没有对应参数则为添加参数,自动补全?
  1. 获取地址栏参数,返回json格式,如果传参,则解析参数返回json格式。

12.2 获取地址栏参数,返回json格式(允许同名name、无=、值为空)

示例:

  1. 获取地址栏单个参数,返回值,如没有则返回''

13.2 获取地址栏单个参数,返回值,如没有则返回''

示例:

  1. 获取经纬度 opts.accuracy: 是否高精度定位; opts.timeout: 超时时间; opts.maxAge: 缓存时长; opts.success: 成功事件 Mobile.getPosition(opts)

  2. 获取当前所在位置 opts.lat: 传入纬度值,如果不传,运用自身getPosition()函数获取纬度; opts.lng: 传入经度值
    其他参数同 getPosition Mobile.getAddress(opts) -- 需申请百度地图ak

  3. 迷你jsonp 回调函数参数名callback opts.url 请求接口地址 opts.data 接口参数 json.time 超时时间-秒,缺省值0 opts.success 成功函数 opts.error 失败函数 Mobile.jsonp(opts)

  4. 迷你ajax

    opts.url 请求接口地址 opts.data 接口参数 json.type 请求格式get or post,缺省值get json.time 超时时间-秒,缺省值5 opts.success 成功函数 opts.error 失败函数 Mobile.ajax(opts)

  5. json转url并添加随机数t

  1. 迫使滚动条到对应位置y ,y缺省值0,即回到顶部

    options.time 回到顶部所需时间,默认 700ms options.type 运动方式,默认 ease-out(减速),其他ease-in(加速)、linear(匀速) options.y 回到距离顶部 Xpx, 默认 0; options.end 回调函数 Mobile.scrollMove(options)

更新日志 2015-6-4 1.0.3 添加 Mobile.shuping 监测手机竖屏事件 1.0.3 添加 Mobile.getSearch(url) 1.0.3 移除 Mobile.reViewCookie(name, str, count)、Mobile.addCookie(name, value, expiresDays) 2015-6-11 1.0.4 优化 Mobile.getSearch 参数不存在的时返回的bug 1.0.4 添加 Mobile.getData(name) 2015-8-6 1.0.5 优化 Mobile.isMobile 改变判断条件替换UA判断 1.0.5 优化 Mobile.scrollMove 运动定时器改为Mobile.setTime 1.0.5 添加 Mobile.setTime(callback) 1.0.5 添加 Mobile.clearTime(id) 2016-3-16 1.0.6 移除某些不必要的东西,更加小巧精简 2016-5-13 1.0.7 支持模快化