@akms/console
v0.0.1
Published
Timestamped console helper with scoped context and call-site preserving bindings. Browser & Node compatible.
Readme
@akms/console
🔒 Internal use only — built for our organization's services.
Timestamped console.* helper with optional scoped context and call-site preserving bindings. Browser-safe (zero Node-only deps besides dayjs). Dual ESM / CJS.
📦 Installation
npm install @akms/console🚀 Usage
import { $console, createConsole } from "@akms/console";
$console.log("직접 호출", { userId: 1 });
// scoped instance via ctx()
const auth = $console.ctx("auth");
auth.log("로그인 완료");
// 2026-04-19 03:30:00 [auth] 로그인 완료
// or build up front
const api = createConsole("api");
api.error(new Error("boom"));Each method (log/info/warn/error/debug) is a getter returning a freshly-bound native console[method]:
- 🕒 Timestamp is current at every call, not stale
- 🔗 DevTools "Source" links point to your caller line, not this library — the bound native function adds no wrapper frame to the stack
🔧 Exports
| Name | Purpose |
|------|---------|
| $console | Pre-initialized singleton (no context) |
| createConsole | (context?: string) => BoundConsole — factory |
| BoundConsole | Type re-export |
