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

auto_error_fixer

v0.1.6

Published

AEF (Auto Error Fixer) - 自动故障修复系统,能够自动检测、修复服务器错误并在必要时重启服务器,支持跨平台错误处理

Readme

AEF (Auto Error Fixer)

AEF (Auto Error Fixer) 是一个强大的Node.js库,用于自动检测、修复服务器错误,并在必要时重启服务器。它还提供了管理控制面板和邮件通知功能,能够帮助原本因BUG而无法运行的系统恢复正常运行。

特性

  • 🔧 自动错误修复 - 智能检测并修复多种常见服务器错误
  • 🛡️ 智能错误处理 - 区分致命和非致命错误,避免不必要的重启
  • 🔄 自动重启 - 当遇到致命错误时自动重启服务器
  • 📊 实时日志 - 详细记录错误前后的情况
  • ⚙️ 管理面板 - 通过Web界面管理AEF设置
  • 📧 邮件通知 - 在发生严重错误时发送邮件通知
  • 🔁 热重载配置 - 配置文件修改后自动生效
  • 🧠 AI驱动预测 - 基于历史错误模式预测潜在问题
  • 📈 性能监控 - 实时分析系统资源使用情况
  • 🌐 分布式支持 - 适用于微服务架构
  • 🛡️ 安全防护 - 自动识别和阻止恶意攻击
  • 🔄 容错能力 - 支持多级备份和故障转移
  • 性能优化 - 动态调整系统参数
  • 📊 智能分析 - 支持自然语言查询和智能报告生成
  • 🌍 跨平台支持 - 自动处理不同操作系统间的路径和命令差异

安装

npm install auto_error_fixer

使用方法

const AEF = require('auto_error_fixer');

// 创建AEF实例
const aef = new AEF();

// 开始监听未捕获的异常
aef.handleUncaughtExceptions();

// 启动控制面板
aef.startPanel();

// 示例Express应用
const express = require('express');
const app = express();
const port = 3000;

app.get('/', (req, res) => {
  res.send('Hello World!');
});

// 使用AEF中间件处理错误
app.use(aef.middleware());

app.listen(port, () => {
  console.log(`应用运行在 http://localhost:${port}`);
});

配置

AEF的配置文件位于 ./DLZstudio/AEF/config/setting.cfg,使用YAML格式。

默认配置:

password: "123456"  # 控制面板密码,默认为123456
enablePanel: true   # 是否启用控制面板
email:              # 邮件配置
  enabled: false    # 是否启用邮件通知
  host: ""          # SMTP服务器地址
  port: 587         # SMTP端口
  secure: false     # 是否使用SSL
  user: ""          # 发送邮箱用户名
  pass: ""          # 发送邮箱密码
  to: ""            # 接收邮箱地址
  content: "# 服务器发生错误\n### AEF遇到了一个无法自动处理的错误,请手动修复\n### AEF正在尝试重启服务器"  # 邮件内容,支持Markdown
autoRestart: true   # 是否自动重启服务器
logLevel: "info"    # 日志级别
aiLearningEnabled: true  # 是否启用AI学习功能
securityEnabled: true    # 是否启用安全防护
performanceMonitoring: true  # 是否启用性能监控

## 支持的错误类型

AEF能够自动检测和处理以下类型的错误:
- 端口被占用 (EADDRINUSE)
- 连接被拒绝 (ECONNREFUSED)
- 文件未找到 (ENOENT) - AEF会尝试创建缺失的文件
- 权限不足 (EACCES) - AEF会尝试修改文件权限
- 磁盘空间不足 (ENOSPC)
- 数据库连接错误 (ECONNRESET) - AEF会尝试重新连接
- 超时错误 (ETIMEDOUT) - AEF会实施重试机制
- 网络错误 (NetworkError) - AEF会尝试重连

## 控制面板

AEF提供了一个Web管理界面,可通过以下URL访问:

http://your-server:3001/panel/AEF


默认密码是 `123456`(可在配置文件中修改)。

控制面板功能:
- 查看AEF运行状态
- 实时查看服务器日志
- 智能日志分析和报告
- AI预测和错误模式分析
- 性能监控和资源使用情况
- 安全活动监控
- 编辑配置文件(热重载)
- 手动启用/禁用AEF
- 手动重启服务器

## 访问控制面板

AEF提供了一个Web管理界面,可通过以下URL访问:

http://your-server:7210/AEF/panel


默认密码是 `123456`(可在配置文件中修改)。

## 高级功能

### AI驱动的错误预测
AEF使用统计学算法分析历史错误模式,预测潜在问题并提前采取措施。请注意,这里的"AI"是指基于规则的预测算法,而非真正的机器学习模型或大语言模型,因此对性能影响极小。

### 性能监控
实时监控CPU、内存、响应时间等关键指标,确保系统最佳性能。

### 安全防护
自动检测和阻止恶意活动,如暴力破解尝试和高频请求攻击。

### 分布式支持
适用于微服务架构,支持跨服务的错误处理和协调。

### 关于"AI"功能的说明
AEF中的"AI"功能实际上是一套轻量级的统计算法,用于分析错误模式和预测潜在问题。这些算法基于简单的概率计算和模式匹配,而非真正的机器学习模型或大语言模型。因此,这些功能对系统性能的影响极小,几乎可以忽略不计。

## 跨平台支持

AEF v0.1.5 引入了强大的跨平台支持功能:

1. **路径标准化**:自动检测并修复不同操作系统间的路径分隔符问题(如Windows的反斜杠\与Unix/Linux/Mac的正斜杠/)
2. **命令适配**:在不同操作系统上执行相应的系统命令(如Windows的taskkill与Linux/Mac的kill)
3. **权限处理**:根据操作系统特性处理文件权限问题
4. **错误检测**:专门检测和处理跨平台移植过程中常见的错误类型

## 如何帮助有问题的应用

AEF特别适用于修复有问题的应用程序:

1. **文件缺失问题**:当应用尝试访问不存在的文件时,AEF会自动创建这些文件
2. **权限问题**:当应用遇到权限错误时,AEF会尝试修复权限设置
3. **数据库连接问题**:当数据库连接失败时,AEF会实施重连策略
4. **网络问题**:当网络请求超时时,AEF会实施重试机制
5. **性能问题**:AEF会监控并优化系统性能
6. **安全问题**:AEF会检测并阻止恶意活动
7. **跨平台问题**:当应用程序从一个操作系统迁移到另一个时,AEF会自动处理路径和命令差异

通过这些功能,AEF可以帮助原本因各种问题而无法运行的应用程序恢复正常运行。

## 许可证

MIT