time-debug
v1.2.2
Published
Add time to debug text for easier logging
Downloads
15
Maintainers
Readme
time-debug
Lightweight timestamp formatter for debug logs – Prepend readable time (and optional username) to any message for easy debugging.
npm install time-debugUsage
const timelog = require('time-debug');
// Basic timestamp log
console.log(timelog("Hello"));
// ➜ [2025-06-07 15:34:21] Hello
// With username prefix
console.log(timelog("Bye", "handsomerabbitcome"));
// ➜ [handsomerabbitcome][2025-06-07 15:34:22] ByeTip
console.log("[INFO]" + timelog("Server started"));
console.log("[ERROR]" + timelog("Unexpected value", "validator"));License
MIT
