1.2.1 • Published 3 months ago
error-visualizer v1.2.1
error-visualizer
An interactive and visually appealing error visualization tool for Node.js. Transform cryptic stack traces into colorful, ASCII art-enhanced displays with helpful tips and an interactive exploration mode.
Features
- 🎨 Colorful error messages with ASCII art
- 🔍 Interactive mode for exploring error details
- 📊 Error statistics tracking
- 🌈 Customizable color themes
- 🌐 Global error handling for uncaught exceptions
- 💡 Helpful tips for common error types
Installation
npm install error-visualizer
Usage
Basic Usage
const { visualizeError } = require('error-visualizer');
try {
// Your code that might throw an error
throw new Error('This is a test error');
} catch (error) {
visualizeError(error);
}
Global Error Handling
const { setupGlobalErrorHandling } = require('error-visualizer');
// Set up global error handling
setupGlobalErrorHandling({ interactive: true });
// Your code here
// Any uncaught errors will be visualized
Interactive Mode
When using the interactive mode, you can:
- View the full stack trace
- See error statistics
- Change the color theme
- Exit the interactive mode
Customization
You can customize the appearance and behavior of the error visualizer:
const { visualizeError } = require('error-visualizer');
// Customize options
const options = {
interactive: true, // Enable interactive mode
theme: 'matrix', // Set initial color theme
};
visualizeError(error, options);
Acknowledgements
Happy debugging! 🐛🔍