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

yuluoo-hospital-utils

v1.0.0

Published

### utils

Readme

玉螺 utils 工具包

utils

is

isBlank :检验是否为空值或空对象或空数组 eg:
isBlank([]); // true
isBlank({}); // true
isBlank(0); // true
isBlank(undefined); // true
isBlank(null); // true
isBlank(false); // true
isBlank(""); // true
isTypeof :判读数据类型
isTypeof([]); // 'array'
isTypeof(null); // 'null'  这里 null 的类型不再是 object
isTypeof(NaN); // 'NaN'  这里 NaN 的类型不再是 number
isLeapYear 是否是闰年
isLeapYear(); // 不传参数则取当前时间年份
isLeapYear(2008); // true
timeFormat :格式化日期
// y-m-d h:m:s  yyyy-mm-dd hh:mm:ss 都可以 只判断是否有 - / 年 字样
// 链接符
timeFormat("2021/01/25 14:23:26", "y-m-d h:m:s"); // "2021-01-25 14:23:26"
timeFormat("2021/01/25 14:23:26", "y/m/d h:m:s"); // "2021/01/25 14:23:26"
// hh:mm
timeFormat("2021/01/25 14:23:26", "y/m/d h:m"); // "2021/01/25 14:23"
// 数字时间戳
timeFormat(1611555806000, "y-m-d h:m"); // "2021/01/25 14:23:26"
// 字符串时间戳
timeFormat("1611555806000", "y-m-d h:m"); // "2021/01/25 14:23:26"
// 中文
timeFormat(new Date(), "y年m月d日 hh:mm:ss")); // 2021年01月26日 15:23:32
isIOS IOS 环境
isAndroid 安卓环境
isIOS(); // true | false
isAndroid(); // true | false
getQuery 获取路由参数
getQuery("http://localhost:8088/live?a=1&b=2&c=2"); // { a: "1", b: "2", c: "2" }
toFixed 保留几位小数
toFiexd("3.1415926", 2); // "3.14"
toFiexd(3.1415926, 2); // "3.14"
padStart 前补白 padEnd 后补白
// 值  要求多少个字符,不够字符数则在前或者后面补上 “0”
padStart("1", 2, "0"); // "01"
padStart("1", 4, "0"); // "0001"
padEnd("1", 2, "0"); // "10"
padEnd("1", 4, "0"); // "1000"

wx 相关

navigateToWithParam 页面跳转
navigateToWithParam({
  url: "http://localhost:8088/live",
  query: { a: "1", b: "2", c: "2" },
  success: () => {},
});

//  http://localhost:8088/live?a=1&b=2&c=2