Production-ready notification system with bulletproof error handling, validation, and user experience features that actually work in real applications.
Try the buttons below. Notice how duplicate messages are prevented and invalid inputs are handled gracefully!
Most toast libraries break in production. Here's what makes this one different:
Invalid parameters don't crash your app. They get logged, reported, and handled gracefully with sensible fallbacks.
Automatically prevents identical messages from spamming users. Based on message content, not timing.
Automatically cleans up DOM elements, event listeners, and empty containers. No manual cleanup required.
Comprehensive logging with context and metadata. Ready for production monitoring tools like Sentry.
npm install bootstrap
# Clone or download the files
import notificationService from './src/notificationService.js';
// Simple usage
notificationService.success('โ
Data saved!');
notificationService.error('โ Something went wrong');
notificationService.warning('โ ๏ธ Check your input');
// Advanced usage
notificationService.showToast('Custom message', 'info', 3000);
The system handles validation, duplicates, cleanup, and error reporting automatically.
Feature | This Library | Basic Bootstrap | Toastr.js |
---|---|---|---|
Input Validation | โ Bulletproof | โ None | โ ๏ธ Basic |
Duplicate Prevention | โ Smart | โ None | โ None |
Memory Management | โ Automatic | โ ๏ธ Manual | โ ๏ธ Manual |
Error Reporting | โ Built-in | โ None | โ None |
Production Ready | โ Yes | โ Fragile | โ ๏ธ Sometimes |