dilipalert 🚀✨
dilipalert is a powerful, dependency-free notification package that works seamlessly in both the terminal and the browser! It allows developers to display colorful, customizable alerts in Node.js apps, browser pages, or Angular components — all without additional dependencies.
✨ Features
- Terminal Notifications: Customizable messages with types:
success, warning, danger, info
- Browser Notifications: Stylish, positionable pop-ups
- Fully Configurable: Control box size, borders, colors, and animation
- Zero Dependencies
- Compatible with Node.js (>=10), Angular, Vanilla JS, and React
📦 Installation
npm install dilipalert
📦 dilipalert Usage Guide
1️⃣ Terminal / Node.js
const { alert } = require('dilipalert');
alert({
message: 'Operation Completed!',
type: 'success',
style: {
border: 'double',
padding: 1,
margin: 1,
},
position: 'top',
});
2️⃣ Browser / Angular / React
import { notifier } from 'dilipalert';
notifier({
message: 'Welcome to dilipalert!',
type: 'info',
position: 'top-right',
animation: 'slide',
style: {
backgroundColor: '#4caf50',
color: '#fff',
fontSize: '16px',
},
});
🛠️ Options
| message | The notification text | '' |
| type | Type of notification (success, warning, danger, info) | info |
| style | Object to customize style (border, padding, colors) | {} |
| position | Position of notification (top, middle, bottom, top-left, etc.) | middle |
| animation | Entry animation in browser notifications (fade, slide, etc.) | fade |
🚀 Example in Angular
import { Component, OnInit } from '@angular/core';
import { notifier } from 'dilipalert';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
})
export class AppComponent implements OnInit {
ngOnInit() {
notifier({
message: 'Angular Notification Ready!',
type: 'success',
position: 'bottom-right',
animation: 'fade',
});
}
}