1.0.3 β€’ Published 8 months ago

@devsahu/loggify v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
8 months ago

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 loggify

Or 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

TypeEmojiColor
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 module

Fix:

  • 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@5

But 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]

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago