{"_id":"@a.nemreen/loggo","_rev":"4-699b6eaee3cc44bbf7a8feb31f726a9b","name":"@a.nemreen/loggo","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@a.nemreen/loggo","version":"0.1.0","keywords":["console","logger","frontend","browser","devtools","dev-only","zero-dependency","typescript","vite","react"],"author":{"name":"Ahmed Nemreen"},"license":"MIT","_id":"@a.nemreen/loggo@0.1.0","maintainers":[{"name":"a.nemreen","email":"a.nemreen@gmail.com"}],"homepage":"https://github.com/nemreen/loggo#readme","bugs":{"url":"https://github.com/nemreen/loggo/issues"},"dist":{"shasum":"b7e53778f3baf1ecb95fb3b87705c009ba608781","tarball":"https://registry.npmjs.org/@a.nemreen/loggo/-/loggo-0.1.0.tgz","fileCount":16,"integrity":"sha512-ebzLxX4GuWCluH4FQntgRy96wrkjAtxR3V5mi3/JnPNIrTJ0EMRlGGHLMeI2ghbduYm9zbsNewWH7P6vP5oIJA==","signatures":[{"sig":"MEYCIQDVBL3p4vIbYefHpWlVZGW6YObOotjsd88o0Fy+nbsLDwIhAM7ivGMg52wGKe/CrW74wMpF+qfROUlTJcCqsu7xQDkx","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":106292},"main":"./dist/prod.cjs","type":"module","types":"./dist/types.d.ts","module":"./dist/prod.js","exports":{".":{"types":"./dist/types.d.ts","default":{"import":"./dist/prod.js","require":"./dist/prod.cjs"},"production":{"import":"./dist/prod.js","require":"./dist/prod.cjs"},"development":{"import":"./dist/dev.js","require":"./dist/dev.cjs"}}},"gitHead":"2e0d2890d626227503384c8d6a2ec43b8e51ad0d","scripts":{"demo":"npm run build && npx --yes serve . -l 4173","build":"tsup","prepublishOnly":"npm run build"},"_npmUser":{"name":"a.nemreen","email":"a.nemreen@gmail.com"},"repository":{"url":"git+https://github.com/nemreen/loggo.git","type":"git"},"_npmVersion":"11.16.0","description":"Beautiful console.log in development. Silent in production.","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","typescript":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/loggo_0.1.0_1784801648553_0.4656422379898717","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@a.nemreen/loggo","version":"0.1.1","keywords":["console","logger","frontend","browser","devtools","dev-only","zero-dependency","typescript","vite","react"],"author":{"name":"Ahmed Nemreen"},"license":"MIT","_id":"@a.nemreen/loggo@0.1.1","maintainers":[{"name":"a.nemreen","email":"a.nemreen@gmail.com"}],"homepage":"http://nemreen.info/loggo","bugs":{"url":"https://github.com/nemreen/loggo/issues"},"dist":{"shasum":"8e811b7257018374785c5e377d0c3cf0ea59f0d0","tarball":"https://registry.npmjs.org/@a.nemreen/loggo/-/loggo-0.1.1.tgz","fileCount":16,"integrity":"sha512-rq/jAz21dHFJYOapYGcm6D0Iz0NKT3ybQhrCU/BfOndLDGv6L6wSodulrFBoFCd4zzBF/gE9H9IZ+AuB1SpFiA==","signatures":[{"sig":"MEUCIC5hWsG6KuTjGmDCTYhi4FCzBv+kKX3er48kLeb6kHmBAiEA6JgDbuQuh5lEYB+J733XOVU8VvOrYDwis4yLN7OJLWA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":106356},"main":"./dist/prod.cjs","type":"module","types":"./dist/types.d.ts","module":"./dist/prod.js","exports":{".":{"types":"./dist/types.d.ts","default":{"import":"./dist/prod.js","require":"./dist/prod.cjs"},"production":{"import":"./dist/prod.js","require":"./dist/prod.cjs"},"development":{"import":"./dist/dev.js","require":"./dist/dev.cjs"}}},"gitHead":"2e0d2890d626227503384c8d6a2ec43b8e51ad0d","scripts":{"demo":"npm run build && npx --yes serve . -l 4173","build":"tsup","prepublishOnly":"npm run build"},"_npmUser":{"name":"a.nemreen","email":"a.nemreen@gmail.com"},"repository":{"url":"git+https://github.com/nemreen/loggo.git","type":"git"},"_npmVersion":"11.16.0","description":"Beautiful console.log in development. Silent in production.","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","typescript":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/loggo_0.1.1_1784801888613_0.16089419974263452","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@a.nemreen/loggo","version":"0.1.2","keywords":["console","logger","frontend","browser","devtools","dev-only","zero-dependency","typescript","vite","react"],"author":{"name":"Ahmed Nemreen"},"license":"MIT","_id":"@a.nemreen/loggo@0.1.2","maintainers":[{"name":"a.nemreen","email":"a.nemreen@gmail.com"}],"homepage":"https://nemreen.info/loggo","bugs":{"url":"https://github.com/nemreen/loggo/issues"},"dist":{"shasum":"ab44713e02cd06ded33eb4c2c97a96805dbfda2a","tarball":"https://registry.npmjs.org/@a.nemreen/loggo/-/loggo-0.1.2.tgz","fileCount":16,"integrity":"sha512-kcNhsCfh/5NH8Hz+8Vq/FrOxkIE4/4MYmn0EzCcZV8lSLfqxW/JYzALIbbjMIgL2J7Ysp8174OXRRppqztMMjw==","signatures":[{"sig":"MEYCIQDugTKB+X2rhuIDoNlVWqzRs0SMN+TPks2no1+CyE99uAIhAIifRJvPWd72OR27jkL0vkq++cedLJalk6z3WmowSVEg","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":106603},"main":"./dist/prod.cjs","type":"module","types":"./dist/types.d.ts","module":"./dist/prod.js","exports":{".":{"types":"./dist/types.d.ts","default":{"import":"./dist/prod.js","require":"./dist/prod.cjs"},"production":{"import":"./dist/prod.js","require":"./dist/prod.cjs"},"development":{"import":"./dist/dev.js","require":"./dist/dev.cjs"}}},"gitHead":"f1e4b622fddf51bb44b9948a290924af7ec9a252","scripts":{"demo":"npm run build && npx --yes serve . -l 4173","build":"tsup","build:site":"node scripts/build-site.mjs","prepublishOnly":"npm run build"},"_npmUser":{"name":"a.nemreen","email":"a.nemreen@gmail.com"},"repository":{"url":"git+https://github.com/nemreen/loggo.git","type":"git"},"_npmVersion":"11.16.0","description":"Beautiful console.log in development. Silent in production.","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","typescript":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/loggo_0.1.2_1784802185037_0.7572827380672089","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@a.nemreen/loggo","version":"0.1.3","description":"Beautiful console.log in development. Silent in production.","author":{"name":"Ahmed Nemreen"},"license":"MIT","type":"module","sideEffects":false,"main":"./dist/prod.cjs","module":"./dist/prod.js","types":"./dist/types.d.ts","exports":{".":{"types":"./dist/types.d.ts","development":{"import":"./dist/dev.js","require":"./dist/dev.cjs"},"production":{"import":"./dist/prod.js","require":"./dist/prod.cjs"},"default":{"import":"./dist/prod.js","require":"./dist/prod.cjs"}}},"scripts":{"build":"tsup","build:site":"node scripts/build-site.mjs","demo":"npm run build && npx --yes serve . -l 4173","prepublishOnly":"npm run build"},"keywords":["console","logger","frontend","browser","devtools","dev-only","zero-dependency","typescript","vite","react"],"homepage":"https://nemreen.info/loggo","devDependencies":{"tsup":"^8.0.0","typescript":"^5.3.0"},"gitHead":"75658b43b80f1d85177a2adb2029c5cf8352beaa","_id":"@a.nemreen/loggo@0.1.3","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-bL9SdMESaaMNM4mZJ0WQu+3k8X6DBbLM5MIwiocoJwNcpYA2qmYEvU3a8sXrHY4UvuI34p0pncRHw7DsVWWhrg==","shasum":"03a843e1b5b954db44dd195ae761fd5a0f142c15","tarball":"https://registry.npmjs.org/@a.nemreen/loggo/-/loggo-0.1.3.tgz","fileCount":16,"unpackedSize":106269,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD00TH1CVan8b0iy/4r4MoEv/9jBJ2omVSrXfUIC5R9OAIgGvHJBKtpN6LAUQQKJOWGeGozTOfV8qlgB1gmZtU7LWs="}]},"_npmUser":{"name":"a.nemreen","email":"a.nemreen@gmail.com"},"directories":{},"maintainers":[{"name":"a.nemreen","email":"a.nemreen@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/loggo_0.1.3_1784910833035_0.8606454797295808"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-23T10:14:08.388Z","modified":"2026-07-24T16:33:53.368Z","0.1.0":"2026-07-23T10:14:08.725Z","0.1.1":"2026-07-23T10:18:08.755Z","0.1.2":"2026-07-23T10:23:05.187Z","0.1.3":"2026-07-24T16:33:53.215Z"},"author":{"name":"Ahmed Nemreen"},"license":"MIT","homepage":"https://nemreen.info/loggo","keywords":["console","logger","frontend","browser","devtools","dev-only","zero-dependency","typescript","vite","react"],"description":"Beautiful console.log in development. Silent in production.","maintainers":[{"name":"a.nemreen","email":"a.nemreen@gmail.com"}],"readme":"<p align=\"center\">\n  <img src=\"https://cdn.jsdelivr.net/npm/@a.nemreen/loggo/assets/logo.png\" alt=\"loggo — // dev logs. prod silent. //\" width=\"320\" />\n</p>\n\n<h1 align=\"center\">@a.nemreen/loggo</h1>\n\n<p align=\"center\">\n  <strong>Develop naturally. Ship silently.</strong><br />\n  Beautiful <code>console.log</code> in development. Silent in production.<br />\n  <em>By Ahmed Nemreen</em>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/@a.nemreen/loggo\"><img src=\"https://img.shields.io/npm/v/@a.nemreen/loggo.svg?style=flat-square\" alt=\"npm version\" /></a>\n  <a href=\"https://www.npmjs.com/package/@a.nemreen/loggo\"><img src=\"https://img.shields.io/npm/dm/@a.nemreen/loggo.svg?style=flat-square\" alt=\"npm downloads\" /></a>\n  <a href=\"https://www.npmjs.com/package/@a.nemreen/loggo\"><img src=\"https://img.shields.io/badge/dependencies-0-brightgreen?style=flat-square\" alt=\"zero dependencies\" /></a>\n  <a href=\"LICENSE\"><img src=\"https://img.shields.io/npm/l/@a.nemreen/loggo.svg?style=flat-square\" alt=\"MIT license\" /></a>\n  <a href=\"https://www.typescriptlang.org/\"><img src=\"https://img.shields.io/badge/types-TypeScript-blue?style=flat-square\" alt=\"TypeScript\" /></a>\n  <a href=\"https://nemreen.info/loggo\"><img src=\"https://img.shields.io/badge/demo-nemreen.info-informational?style=flat-square\" alt=\"live demo\" /></a>\n</p>\n\n---\n\n## Why loggo?\n\nFrontend apps fill up with temporary `console.log` calls. Before release you either:\n\n- hunt them down by hand\n- fight lint rules\n- wrap every call in `if (import.meta.env.DEV)`\n- or ship noisy (sometimes sensitive) output to users' consoles\n\n**loggo** is a drop-in replacement: styled DevTools output while you build, and a **silent noop build in production** — so debug clutter never reaches the browser console.\n\nArguments are forwarded to native `console.*`. Objects stay expandable, DOM nodes stay inspectable, errors keep their stacks. Nothing is `JSON.stringify`'d.\n\n---\n\n## Install\n\n```bash\nnpm install @a.nemreen/loggo\n```\n\n```bash\npnpm add @a.nemreen/loggo\n```\n\n```bash\nyarn add @a.nemreen/loggo\n```\n\n```bash\nbun add @a.nemreen/loggo\n```\n\n**Requirements:** a modern bundler that honors package `exports` conditions (Vite, Webpack 5, Next.js, Rollup, esbuild, Parcel, and similar). Browser-first — not a Node/server logger.\n\n---\n\n## Quick start\n\n```ts\nimport { log } from '@a.nemreen/loggo';\n\nlog('Application initialized');\nlog('Current user:', user);\nlog('Selected element:', document.querySelector('#app'));\n\nlog.debug('Cache state:', cache);\nlog.info('User loaded:', user);\nlog.warn('Token expires soon');\nlog.error('Request failed:', error);\n```\n\nOpen DevTools. In development you get timestamps and level badges. In a production build you get **nothing**.\n\n---\n\n## How to use\n\n### 1. Replace `console.log`\n\n```ts\n// before\nconsole.log('user', user);\n\n// after\nimport { log } from '@a.nemreen/loggo';\nlog('user', user);\n```\n\n`log(...)` and `log.log(...)` are the same.\n\n### 2. Use levels when it helps\n\n| Method        | Console method | Badge |\n|---------------|----------------|-------|\n| `log.debug()` | `console.debug` | DEBUG |\n| `log()` / `log.log()` | `console.log` | LOG |\n| `log.info()`  | `console.info`  | INFO |\n| `log.warn()`  | `console.warn`  | WARN |\n| `log.error()` | `console.error` | ERROR |\n\n```ts\nlog.debug('verbose detail', payload);\nlog.info('something happened', data);\nlog.warn('be careful', context);\nlog.error('it broke', error);\n```\n\n### 2b. Full console surface\n\nEvery common DevTools helper is mirrored and silent in production:\n\n| Method | Native |\n|--------|--------|\n| `log.dir()` / `log.dirxml()` | inspect object / DOM tree |\n| `log.table()` | tabular data |\n| `log.group()` / `log.groupCollapsed()` / `log.groupEnd()` | collapsible groups |\n| `log.time()` / `log.timeLog()` / `log.timeEnd()` | timers |\n| `log.count()` / `log.countReset()` | counters |\n| `log.assert()` | log only when condition is false |\n| `log.trace()` | stack trace |\n| `log.clear()` | clear console |\n| `log.timeStamp()` / `log.profile()` / `log.profileEnd()` | performance markers |\n\n```ts\nlog.table(users, ['id', 'name']);\nlog.group('checkout');\nlog.time('pay');\nlog.count('retry');\nlog.timeEnd('pay');\nlog.groupEnd();\nlog.assert(total > 0, 'total must be positive', { total });\nlog.trace('how did we get here?', ctx);\n```\n\n### 3. Name loggers per module\n\n```ts\nimport { createLoggo } from '@a.nemreen/loggo';\n\nconst apiLog = createLoggo({ name: 'API' });\nconst authLog = createLoggo({ name: 'Auth' });\n\napiLog('Request started', { method: 'GET', path: '/users' });\napiLog.info('Response received', response);\nauthLog.warn('Session almost expired');\napiLog.error('Request failed', error);\n```\n\nExample DevTools output:\n\n```text\n12:14:02 › API  LOG\n  Request started  {…}\n\n12:14:03 › API  INFO\n  Response received  {…}\n\n12:14:05 › Auth WARN\n  Session almost expired\n\n12:14:06 › API  ERROR\n  Request failed  Error: …\n```\n\n### 4. Pass any value — keep DevTools native\n\n```ts\nlog('primitives', 'hello', 123, true, null);\nlog('object', { id: 1, nested: { ok: true } });\nlog('array', [1, 2, 3]);\nlog('function', (x) => x * 2);\nlog('dom', document.querySelector('#app'));\nlog('error', new Error('boom'));\n\nconst circular = { label: 'node' };\ncircular.self = circular;\nlog('circular', circular); // safe — not JSON.stringified\n```\n\n### 5. Framework notes\n\n**Vite / Vitest** — mode maps to `development` / `production` export conditions automatically.\n\n**Next.js (App or Pages)** — client components and browser bundles resolve the matching build. Prefer loggo for **client-side** debug logs; use your server logger or monitoring for the backend.\n\n**Create React App / Webpack 5** — production builds resolve the silent entry.\n\n**SSR caveat:** if a resolver does not understand export conditions, the **default is silent** (fail closed). That is intentional.\n\n---\n\n## Landing & demo\n\nInteractive landing: boot line, typewriter code, CRT sample stream, and live DevTools cases.\n\n**Live:** [https://nemreen.info/loggo](https://nemreen.info/loggo)\n\nLocal:\n\n```bash\nnpm install\nnpm run demo\n```\n\nOpen [http://localhost:4173/demo/](http://localhost:4173/demo/).\n\n**cPanel deploy**\n\n```bash\nnpm run build:site\n```\n\nUpload the contents of `site/` (or unzip `loggo-cpanel.zip`) into `public_html/loggo/` so `index.html` is at `public_html/loggo/index.html`.\n\n| Section | What you get |\n|---------|----------------|\n| Hero | Logo stamp-in + typed `// dev logs. prod silent. //` |\n| Install / usage | Typewriter shell + `app.ts` snippets |\n| Live console | Looping CRT-style sample output |\n| Try samples | Real `@a.nemreen/loggo` calls in your DevTools |\n| Named / before-after | API logger example + migration contrast |\n\n---\n\n## How production silence works\n\nloggo ships **two builds**:\n\n| Condition | Entry | Behavior |\n|-----------|--------|----------|\n| `development` | styled logger | timestamps + badges + native args |\n| `production` | noop logger | every method is `() => {}` |\n| `default` (fallback) | noop logger | silent if conditions are unknown |\n\nBundlers pick the entry by build mode. Production apps import the noop file directly — no per-call `if (isProd)` checks, and no reliance on dead-code elimination to strip the pretty path.\n\n**All levels are silent in production**, including `warn` and `error`. Real production errors belong in Sentry (or similar) — not in the user's console via loggo.\n\n---\n\n## API\n\n```ts\nexport type LogFn = (...args: unknown[]) => void;\n\nexport interface Loggo {\n  (...args: unknown[]): void;\n  debug: LogFn;\n  log: LogFn;\n  info: LogFn;\n  warn: LogFn;\n  error: LogFn;\n  dir: (item?: unknown, options?: Record<string, unknown>) => void;\n  dirxml: LogFn;\n  table: (data?: unknown, columns?: string[]) => void;\n  group: LogFn;\n  groupCollapsed: LogFn;\n  groupEnd: () => void;\n  time: (label?: string) => void;\n  timeLog: (label?: string, ...data: unknown[]) => void;\n  timeEnd: (label?: string) => void;\n  count: (label?: string) => void;\n  countReset: (label?: string) => void;\n  assert: (condition?: boolean, ...data: unknown[]) => void;\n  trace: LogFn;\n  clear: () => void;\n  timeStamp: (label?: string) => void;\n  profile: (label?: string) => void;\n  profileEnd: (label?: string) => void;\n}\n\nexport interface LoggoOptions {\n  /** Shown beside the level badge; also scopes time/count labels */\n  name?: string;\n}\n\n/** Shared default logger */\nexport declare const log: Loggo;\n\n/** Create a named (or extra) logger instance */\nexport declare function createLoggo(options?: LoggoOptions): Loggo;\n```\n\nStyled level lines use a blank line above the badge and put arguments on the next line so DevTools output stays readable instead of cramped.\n\n---\n\n## What it replaces / what it doesn't\n\n**Replaces**\n\n```ts\nconsole.log(...)\nconsole.info(...)\nconsole.warn(...)\nconsole.error(...)\nconsole.debug(...)\nconsole.table(...)\nconsole.dir(...)\nconsole.group(...)\nconsole.time(...)\n// …and the rest of the console helpers mirrored on `log`\n```\n\n```ts\nif (import.meta.env.DEV) {\n  console.log(...);\n}\n```\n\n**Does not replace**\n\n- Sentry / Datadog / browser monitoring\n- Pino / Winston / backend logging\n- Analytics or audit trails\n- Shipping logs to a server\n\n---\n\n## Security\n\nHelps prevent **accidental exposure of debugging data** through the production browser console.\n\nIt does **not** guarantee that secrets or personal data never reach the client. loggo only silences its own console output. It cannot protect values already present in frontend code, API responses, storage, or network traffic.\n\n---\n\n## Browser support\n\nDesigned for modern Chromium, Firefox, and Safari DevTools. Uses `console.*` with `%c` styling and `Intl.DateTimeFormat`. No polyfills. No runtime dependencies.\n\n---\n\n## Project scripts\n\n```bash\nnpm run build   # emit dist (dev + prod + types)\nnpm run demo    # build + serve interactive demo\n```\n\n---\n\n## Links\n\n- **npm:** [npmjs.com/package/@a.nemreen/loggo](https://www.npmjs.com/package/@a.nemreen/loggo)\n- **Demo:** [nemreen.info/loggo](https://nemreen.info/loggo)\n- **License:** [MIT](LICENSE)\n\n---\n\n<p align=\"center\">\n  <strong>Develop naturally. Ship silently.</strong><br />\n  <sub>// dev logs. prod silent. //</sub><br />\n  <sub>By Ahmed Nemreen</sub>\n</p>\n","readmeFilename":"README.md"}