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

@qiulei/toolboxjs

v1.1.1

Published

该项目提供了一系列 JavaScript 开发的工具函数,以及一个 Vue 插件,用于自动注册指定目录下的 Vue 组件。工具函数涵盖数据处理、距离计算和字符串操作等多种功能。

Downloads

5

Readme

项目名称

概述

该项目提供了一系列 JavaScript 开发的工具函数,以及一个 Vue 插件,用于自动注册指定目录下的 Vue 组件。工具函数涵盖数据处理、距离计算和字符串操作等多种功能。

工具函数

utils.js 文件包含以下工具函数:

  • arrayToTree(data): 将扁平数组转换为基于 idparentId 的树形结构。
  • calculateDistance(lat1, lon1, lat2, lon2): 计算两个地理坐标(纬度和经度)之间的距离,单位为公里。
  • copyToClipboard(text): 将文本复制到剪切板。
  • dayOfYear(date): 获取某个日期在当年的天数。
  • deepCloneJSON(obj): 使用 JSON 方法进行深拷贝。
  • deepClone(obj): 自定义深拷贝函数,支持对象和数组。
  • formatDate(date): 格式化日期为 YYYY-MM-DD。
  • generateUUID(): 生成 UUID。
  • gray(r, g, b): 将 RGB 颜色转换为灰度值。
  • isValidEmail(email): 检查邮箱格式是否有效。
  • mergeObjects(target, ...sources): 合并多个对象。
  • parseURL(url): 解析 URL,提取信息。
  • parseQuery(url): 解析 URL 中的查询参数。
  • toCamelCase(str): 将字符串转换为驼峰命名法。
  • pick(obj, ...props): 筛选对象属性。
  • randomColor(): 生成随机 HEX 颜色。
  • getRandomNumber(min, max): 生成指定范围的随机数。
  • randomString(): 生成随机字符串。
  • removeTag(fragment): 去掉字符串中的 HTML 标签。
  • reverseString(str): 反转字符串。
  • uniqueArray(arr): 去重数组。