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

mp-doctor-cli

v1.0.1

Published

A comprehensive CLI tool for frontend project analysis and optimization

Readme

MP Doctor CLI

一个用于涂鸦小程序项目分析和优化的强大命令行工具

npm version License: MIT TypeScript

功能特性

  • 🔍 依赖检查 - 检测重复依赖,优化包体积
  • 🖼️ 图片优化 - 极致压缩,支持多种格式
  • 📊 代码分析 - 构建体积分析,性能优化建议
  • 📦 体积计算 - 精确计算项目打包大小
  • 🌐 CDN转换 - 将大图片转为CDN方式,减少包体积
  • 一键分析 - 运行所有功能,实时查看进度

快速开始

安装

npm install -g mp-doctor-cli

使用

# 一键分析所有功能
mp-doctor check all

# 单独功能
mp-doctor check deps          # 检查依赖
mp-doctor optimize images     # 优化图片
mp-doctor analyze code        # 分析代码
mp-doctor calculate size      # 计算体积
mp-doctor cdn                 # CDN转换(涂鸦小程序)

### CDN转换功能

针对涂鸦小程序项目,自动将大于5KB的图片转为CDN方式,有效减少包体积。

```bash
# 基础用法(默认扫描src目录)
mp-doctor cdn

# 自定义扫描目录
mp-doctor cdn --source-dir "assets"

# 自定义阈值(10KB)
mp-doctor cdn --threshold 10

# 预览模式(不实际修改文件)
mp-doctor cdn --dry-run

# 指定项目配置
mp-doctor cdn --project-name "myApp" --project-id "your-project-id"
```

**功能特性:**
- 🔍 默认扫描 `src` 目录,支持自定义扫描目录
- 📏 根据文件大小智能筛选需要CDN处理的图片
- 📁 自动创建CDN目录和配置文件
- 🔧 生成涂鸦小程序CDN配置(project.tuya.json)
- 📝 提供详细的使用指南和示例代码
- 🔄 标记需要手动更新的代码文件

**版本要求:**
- 基础库版本 >= 2.26.0
- @ray-js/ray 版本 >= 1.6.10
- 开发者工具版本 >= 0.10.0

## 开发

```bash
# 克隆项目
git clone https://github.com/mp-doctor/mp-doctor-cli.git
cd mp-doctor-cli

# 安装依赖
npm install

# 开发模式
npm run dev

# 构建
npm run build

# 测试
npm test

许可证

MIT © MP Doctor Team