@devsahu/loggify
v1.0.3
Published
A tiny, colorful, emoji-enhanced logger for Node.js projects — powered by [chalk](https://github.com/chalk/chalk). Perfect for CLI tools, debug logs, or just having some fun in your terminal.
Downloads
14
Readme
Loggify 🚀
A tiny, colorful, emoji-enhanced logger for Node.js projects — powered by chalk. Perfect for CLI tools, debug logs, or just having some fun in your terminal.
✨ Features
- Easy-to-use logger with semantic types (
success,error,warn,info,debug, etc.) - Timestamps included (optional)
- Emojis and colored labels for better visibility
- Minimal and fast — zero runtime dependencies (besides
chalk)
📦 Installation
npm install loggifyOr using yarn:
yarn add loggify🚀 Usage
import { loggify } from 'loggify';
loggify('success', 'Operation completed successfully!');
loggify('error', 'Something went wrong!');
loggify('info', 'Here is some information.');
loggify('warn', 'This is a warning.');
loggify('debug', 'Debugging details...');
loggify('rocket', 'Launching...');
loggify('heart', 'We love open source!');⚙️ Options
The loggify function accepts an optional third argument for options:
loggify(type, message, { timestamp: true });Available Types
| Type | Emoji | Color | | ------- | ----- | ------------ | | success | ✅ | Green Bold | | error | ❌ | Red Bold | | warn | ⚠️ | Orange Bold | | info | ℹ️ | Blue | | debug | 🐛 | Gray | | rocket | 🚀 | Cyan Bold | | heart | ❤️ | Magenta Bold |
🧪 Example Output
[12:34:56 PM] ✅ SUCCESS: Operation completed!
[12:34:56 PM] ❌ ERROR: Something went wrong!
[12:34:56 PM] 🚀 ROCKET: Launching...⚠️ Common Issues & Fixes
1. ❌ Cannot use ES modules (import/export)
If you get errors like:
SyntaxError: Cannot use import statement outside a moduleFix:
- In your
package.json, add:
"type": "module"Or switch to CommonJS syntax:
const chalk = require('chalk');
// ...
module.exports = { loggify };2. ❌ chalk.keyword is not a function
This only works in chalk v4+ with full color support.
✅ Make sure you're using a compatible version:
npm install chalk@5But note: chalk@5** is pure ESM**, so you must use "type": "module" in package.json.
3. ❌ Doesn’t log anything
- Ensure you’re calling the function in a test file or at the bottom of your script.
- Example:
loggify("rocket", "Launching the app!");📄 License
MIT © 2025 [Your Name or GitHub Handle]
