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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@frost-utils/javascript

v2.1.3

Published

A JavaScript utility library.

Downloads

74

Readme

@frost-utils/javascript

函数列表

通用函数

  • common/compareString - 使用 localeCompare 对比字符串

  • common/dataPagination - 分页处理

  • common/dataToRanks - 将数据拆分为行列

  • common/defaultValue - 传入值为 undefinednull 时返回默认值

  • common/getCommonDateTime - 获取 yyyy-MM-dd HH:mm:ss 格式的日期时间字符串

  • common/getObjectValue - 通过路径获取对象属性值

  • common/getObjectsAttr - 获取多个对象中的某个属性

  • common/isArray - 检测参数是否为数组

  • common/isObject - 检测参数是否为对象

  • common/mergeObject - 合并对象属性

  • common/mergeObjects - 对比多个对象的数据,合并为一个对象

  • common/rectCollisionCheck - 检测两个矩形区域是否重叠

  • common/sleep - 等待一段时间

  • common/toBroadcastAddress - 将 IP 地址转换为广播地址

  • common/color/getHEXColor - 获取随机的十六进制颜色值

  • common/color/getRGBColor - 获取随机的 RGB 颜色值

浏览器专用

  • browser/isElement - 检测参数是否为 Element

  • browser/isHTMLElement - 检测参数是否为 HTMLElement

  • browser/observeElementVisible - 检测元素显示隐藏

  • browser/rectCollisionCheck - 检测两个矩形元素是否重叠

  • browser/data-url/blobToDataURL - 转换二进制(Blob)为 Base64

  • browser/data-url/requestDataURL - 请求获取文件,转换为 Base64

  • browser/data-url/selectFileDataURL - 选择单个文件,获取 Base64