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

sc-performance-util

v1.0.0

Published

专业的Web性能数据提取和分析工具,支持HAR和Performance Timeline文件分析,自动生成AI分析友好的报告

Readme

sc-performance-util

一个专业的Web性能数据提取和分析工具,专门解决大型性能文件难以被AI直接分析的问题。支持通过 NPX 一键使用,无需安装。

🎯 核心特点

解决AI分析难题

  • 大文件处理: 智能提取HAR文件和Performance Timeline中的关键信息,解决源文件过大导致AI无法有效分析的问题
  • 结构化输出: 将复杂的性能数据转换为AI友好的结构化格式,大幅提升分析准确性
  • 精准问题定位: 自动识别性能瓶颈和异常,生成针对性的分析报告

AI增强功能

  • 智能提示生成: 自动生成优化的AI分析提示,帮助AI更准确地识别性能问题
  • 上下文保留: 保留关键性能指标和时序关系,确保AI分析的完整性
  • 多维度分析: 从网络、渲染、JavaScript执行等多个维度提取关键数据

🚀 快速上手

方式一:交互式模式(推荐 ⭐)

最简单的使用方式,无需记忆任何命令:

npx sc-performance-util

工具会自动引导你完成:

  • 📁 智能扫描并选择文件
  • 📂 配置输出目录
  • 📋 选择输出格式
  • ✅ 确认后一键分析

方式二:命令行模式

适合自动化和脚本场景:

# 分析HAR文件 - 自动生成AI分析友好的报告
npx sc-performance-util analyze your-file.har

# 分析Performance Timeline文件
npx sc-performance-util analyze timeline.json

# 指定输出目录和格式
npx sc-performance-util analyze your-file.har -o ./reports --format both

# 查看帮助信息
npx sc-performance-util --help

本地开发安装

如果需要本地开发或自定义功能:

# 克隆项目
git clone https://github.com/adi0754/sc-performance-util.git
cd sc-performance-util

# 安装依赖
pnpm install

# 快速开始(交互式模式)
pnpm start

# 或使用传统方式
pnpm extract input/your-file.har

命令说明

npx sc-performance-util              # 交互式模式(推荐)
npx sc-performance-util <命令> [选项]  # 命令行模式

命令:
  analyze <文件路径>  分析HAR或Performance Timeline文件

选项:
  -o, --output <目录>    指定输出目录 (默认: ./results)
  --format <格式>        输出格式: json|markdown|both (默认: both)
  -h, --help            显示帮助信息
  -v, --version         显示版本信息

输出说明

工具会生成两个文件:

  • *-extracted.json: 结构化的性能数据
  • *-ai-prompt.md: 专为AI分析优化的Markdown报告

将生成的 *-ai-prompt.md 文件直接提供给AI工具(如ChatGPT、Claude等),即可获得精准的性能分析和优化建议。

💼 使用场景

  • 性能调试: 当HAR文件太大无法直接分析时
  • AI辅助分析: 需要AI帮助识别复杂性能问题时
  • 自动化分析: 批量处理多个性能文件时
  • 团队协作: 生成标准化的性能报告供团队讨论
  • 快速诊断: 无需安装,直接通过 NPX 快速分析性能文件

📦 作为依赖使用

方式一:命令行使用

在项目中安装并使用:

npm install sc-performance-util
# 或
pnpm add sc-performance-util

package.json 中添加脚本:

{
  "scripts": {
    "perf": "sc-performance-util",
    "perf:analyze": "sc-performance-util analyze"
  }
}

使用:

# 交互式模式
npm run perf

# 命令行模式
npm run perf:analyze -- your-file.har

方式二:编程调用

import PerformanceExtractor from 'sc-performance-util';

const extractor = new PerformanceExtractor();
await extractor.processFile('your-file.har', './output', 'both');

📄 许可证

MIT License