console-pretify
v0.2.0
Published
A lightweight, zero-dependency console logger with colors and timestamps.
Maintainers
Readme
console-pretify
Simple lightweight JavaScript console logger with colors, timestamps, and clean formatting.
Made by Tonie
NPM Download console-pretify
Install
npm install console-pretifyBasic Usage
import { log, warn, error, success } from "console-pretify";
log("Server started");
warn("Low memory warning");
error("Something failed");
success("All good");Custom Logger
import { createLogger } from "console-pretify";
const api = createLogger({
prefix: "API",
timestamp: true
});
api.log("Fetching data");
api.warn("Slow response");
api.error("Request failed");
api.success("Done");Output Example
[7:21:13 PM] [INFO] Server started
[7:21:13 PM] [WARN] Low memory warning
[7:21:13 PM] [ERROR] Something failed
[7:21:13 PM] [SUCCESS] All goodAPI
| Function | Description | |----------|-------------| | log() | Info log | | warn() | Warning log | | error() | Error log | | success() | Success log |
createLogger Options
| Option | Type | Description | |-----------|--------|-------------| | prefix | string | Adds a tag before logs | | timestamp | boolean | Shows time in logs |
Features
- Colored console output
- Lightweight and dependency-free
- Custom logger support
- Timestamp support
- Prefix tagging
License
MIT
Author
- Tonie Made with simplicity in mind for developers who want clean console output.
