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 🙏

© 2025 – Pkg Stats / Ryan Hefner

jvtools

v1.0.10

Published

js常见方法工具包

Downloads

15

Readme

Tool-box-js

javascript开发常用方法工具包

文档地址

版本日志

v.1.0.10【未发布】

v.1.0.9

新增

Cookies.getAll()-获取所有Cookie

Cookies.get(name)-获取指定名称的cookie

Cookies.clearAll()-清除所有Cookie

mapMerge(mapObj, key, value, remappingFunction)-js 实现 java 中的 mapMerge 功能

Format.LatAndLong(lat, long)-检查并得到正确的经纬度

decimalToBaseBit(decimal, bit = 10)-10进制转x进制

baseBitToDecimal(str, bit = 10)-x进制转10进制

createMatrix(row=1, column=1)-构建矩阵

结构调整

  • 抽离出Cookies方法类,下一版clearCookies方法,变为Cookies.clearAll

v1.0.8

新增

clearCookies()-清除所有Cookie

Time.dayDif(date1,date2)-获取两日期天数差

rgbToHex(r,g,b)-rgb转十六进制字符

getCookie(name)-获取cookie

calcDistance(loc1, loc2, splitStr = ',')-计算两地经纬度距离

Time.isLeapYear(year)-判断是否为润年

v1.0.7

新增

numFixed(num, [precision = 2])-指定小数位进行四舍五入

fahrenheitToCelsius(celsius)-摄氏度转华氏度

Format.celsiusToFahrenheit(celsius)-摄氏度转华氏度

getPerformance()-获取当前页面性能参数

Time.isDateValid(...args)-检查日期是否有效

getBaseURL(url)-获取不带参数的base URL

v1.0.6

新增

iteratorObj(obj)-可迭代对象方法

feat: 添加首字母大写方法

feat: 添加时间格式化

strIsReg(str)-判断字符串是否为正则表达式

feat: 添加字符串转换正则表达式方法

修复

fix: 修复数组对象元素匹配相等bug

v1.0.5

deleteByPath(obj, path, [splitStr='.'])-根据路径删除对象目标键值

v1.0.4

feat: 添加Time类日期转换星期方法

v1.0.3

添加

arrayIsEqual(arr1,arr2)-数组比较方法

debounce(fun, wait)-防抖

throttle(fun, wait)-节流

curry(func, [arity=func.length])-柯里化函数

Format.formatMoney(money, [symbol = "", decimals = 2])-格式化价格

feat: 添加校验类

isEmpty(val)-空对象判断

groupByValue(obj)-收集相同值方法

nestByKey(items, [id = null, link = 'parentId'])-构建树形结构

filterObj(obj,arr)-过滤对象方法

objToPath(obj)-对象转化成url参数

pathToObj(str)-路径参数解析成对象