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

@ray-js/audit-rate-utils

v1.8.3

Published

Utility library with dual CJS and ESM support

Downloads

1,534

Readme

@ray-js/audit-rate-utils

小程序性能评分工具库,提供了一套完整的性能评分机制,支持多种性能指标的评估和打分。

功能特性

  • 支持 CJS 和 ESM 双模块系统
  • 提供多项性能评分指标
  • 灵活的评分配置
  • 支持自定义评分钩子

安装

npm install @ray-js/audit-rate-utils

主要评分指标

该工具库支持以下性能指标的评估:

  • 图片并发请求检查
  • TTT 并发调用检查
  • HTTPS 合规性检查
  • 启动时间评估
  • 页面渲染性能
  • 网络请求性能
  • 暗黑模式支持
  • 多语言使用情况
  • 安全区域兼容性
  • 包体积检查
  • 图片资源优化
  • JS 错误日志
  • 等等

使用方法

import { calcAudit } from '@ray-js/audit-rate-utils';

// 计算性能评分
const result = calcAudit(sourceData, {
  // 可选的钩子函数
  onCalcAuditTask: (task) => {
    // 处理单个评分任务结果
  },
  onCalcCategoryiesScore: (categories) => {
    // 处理分类评分结果
  },
  onCalcTotalScore: (total) => {
    // 处理总评分结果
  }
});

API 说明

calcAudit(sourceData, hooks?)

主要评分函数,用于计算小程序的综合性能评分。

参数

  • sourceData: 评分所需的原始数据
  • hooks: 可选的钩子函数对象
    • onCalcAuditTask: 计算单个评分任务时的回调
    • onCalcCategoryiesScore: 计算分类评分时的回调
    • onCalcTotalScore: 计算总评分时的回调

返回值

返回包含以下信息的评分结果:

  • 任务评分详情
  • 分类评分
  • 总评分和等级

许可证

MIT