notifyalert 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.
-
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
npm install notifyalert
const { alert } = require('notifyalert');
alert({
message: 'Operation Completed!',
type: 'success', // Options: 'success', 'warning', 'danger', 'info'
style: {
border: 'double', // Options: 'single', 'double', 'round'
padding: 1,
margin: 1,
},
position: 'top', // Options: 'top', 'middle', 'bottom'
});
import { notifier } from 'notifyalert';
notifier({
message: 'Welcome to notifyalert!',
type: 'info', // Options: 'success', 'warning', 'danger', 'info'
position: 'top-right', // Options: 'top-left', 'top-right', 'bottom-left', 'bottom-right'
animation: 'slide', // Options: 'fade', 'slide', etc.
style: {
backgroundColor: '#4caf50',
color: '#fff',
fontSize: '16px',
},
});
Option | Description | Default |
---|---|---|
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 |
import { Component, OnInit } from '@angular/core';
import { notifier } from 'notifyalert';
@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',
});
}
}