dlip
v0.0.2
Published
Customizable terminal notifier for success, warning, danger, info with styling options
Downloads
186
Maintainers
Keywords
Readme
dlip 🚀✨
dlip 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 dlip
📦 dlip Usage Guide
1️⃣ Terminal / Node.js
const { alert } = require('dlip');
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'
});
2️⃣ Browser / Angular / React
import { notifier } from 'dlip';
notifier({
message: 'Welcome to dlip!',
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',
},
});
🛠️ Options
| 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
|
🚀 Example in Angular
import { Component, OnInit } from '@angular/core';
import { notifier } from 'dlip';
@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',
});
}
}