{"_id":"@asd14/fancy-logger","_rev":"2-9df702201f286b4cf01defdc37ceefc5","name":"@asd14/fancy-logger","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.0":{"name":"@asd14/fancy-logger","version":"0.1.0","author":{"url":"https://github.com/andreidmt","name":"Andrei Dumitrescu"},"license":"MIT","_id":"@asd14/fancy-logger@0.1.0","maintainers":[{"name":"andreid","email":"andrei.dumitrescu@pm.me"}],"homepage":"https://github.com/asd-xiv/fancy-logger#readme","bugs":{"url":"https://github.com/asd-xiv/fancy-logger/issues"},"nx":{"tags":["type:library","target:any","runtime:any"],"projectType":"library"},"dist":{"shasum":"3bad7d6e1ac00b8c022b2df81efe058e58c02d09","tarball":"https://registry.npmjs.org/@asd14/fancy-logger/-/fancy-logger-0.1.0.tgz","fileCount":17,"integrity":"sha512-JAJcJgpvDQTOjWNwVSVAo3itogVT+Cz4pJoZQ8vdA6RBfayWqiCSo36o6Z64yjp09KyL6nJc7NZwH73789xpAg==","signatures":[{"sig":"MEUCIQCB4MAw2otNsU27UUhkOVgxdQyKaN3xa4MWzr53DOemMgIgCkvW4EMTimXJiFG3L2dka39OeDPwHKbFF+1MEMuu/Z4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34338},"type":"module","engines":{"node":">=22.12.0"},"exports":{"./node":{"types":"./dist/index.node.d.ts","import":"./dist/index.node.js","default":"./dist/index.node.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.js","default":"./dist/index.browser.js"},"./package.json":"./package.json"},"scripts":{"lint":"eslint --quiet .","build":"npm run build:code && npm run build:types","format":"eslint --fix .","prepare":"git config --local core.hooksPath .githook","coverage":"c8 --100 --exclude='src/**/*.test.ts' npm run test:code","----UTILS":"","typecheck":"npm run typecheck:code && npm run typecheck:tests && npm run typecheck:other","unit-test":"npm run unit-test:code","----BUNDLE":"","build:code":"swc src -d dist --strip-leading-paths","clear:dist":"rm -rf dist/*","----CODE-QA":"","build:types":"tsc --declaration --emitDeclarationOnly --project ./.tsconfig/code.json","prebuild:code":"npm run clear:dist","clear:ts-cache":"rm -f node_modules/.tmp/*.tsbuildinfo","prebuild:types":"npm run clear:ts-cache","typecheck:code":"tsc --noEmit --project ./.tsconfig/code.json","unit-test:code":"TSX_TSCONFIG_PATH=.tsconfig/tests.json node --import tsx --test 'src/**/*.test.ts'","typecheck:other":"tsc --noEmit --project ./.tsconfig/other.json","typecheck:tests":"tsc --noEmit --project ./.tsconfig/tests.json"},"_npmUser":{"name":"andreid","email":"andrei.dumitrescu@pm.me"},"repository":{"url":"git+https://github.com/asd-xiv/fancy-logger.git","type":"git"},"_npmVersion":"11.17.0","description":"Fancy console logger for Node.js and browser","directories":{},"sideEffects":false,"_nodeVersion":"22.19.0","dependencies":{"@asd14/node-utils":"^3.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^11.0.0","tsx":"^4.22.4","eslint":"^9.39.2","@swc/cli":"^0.8.1","prettier":"^3.8.4","@swc/core":"^1.15.41","typescript":"^6.0.3","yocto-spinner":"^1.2.0","@commitlint/cli":"^21.0.2","@asd14/ts-config":"^1.5.0","semantic-release":"^25.0.5","@asd14/eslint-config":"^15.4.0","@asd14/eslint-plugin":"^3.3.0","@semantic-release/git":"^10.0.1","@asd14/prettier-config":"^1.4.0","@commitlint/config-conventional":"^21.0.2","conventional-changelog-conventionalcommits":"^9.3.1"},"peerDependencies":{"yocto-spinner":"^1.2.0"},"peerDependenciesMeta":{"yocto-spinner":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/fancy-logger_0.1.0_1781508954158_0.8927041116860674","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@asd14/fancy-logger","version":"1.0.0","description":"Fancy console logger for Node.js and browser","license":"MIT","sideEffects":false,"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/asd-xiv/fancy-logger.git"},"author":{"name":"Andrei Dumitrescu","url":"https://github.com/andreidmt"},"nx":{"projectType":"library","tags":["type:library","target:any","runtime:any"]},"type":"module","exports":{"./node":{"import":"./dist/index.node.js","default":"./dist/index.node.js","types":"./dist/index.node.d.ts"},"./browser":{"import":"./dist/index.browser.js","default":"./dist/index.browser.js","types":"./dist/index.browser.d.ts"},"./package.json":"./package.json"},"scripts":{"----UTILS":"","prepare":"git config --local core.hooksPath .githook","format":"eslint --fix .","clear:dist":"rm -rf dist/*","clear:ts-cache":"rm -f node_modules/.tmp/*.tsbuildinfo","----BUNDLE":"","prebuild:code":"npm run clear:dist","build:code":"swc src -d dist --strip-leading-paths","prebuild:types":"npm run clear:ts-cache","build:types":"tsc --declaration --emitDeclarationOnly --project ./.tsconfig/code.json","build":"npm run build:code && npm run build:types","----CODE-QA":"","lint":"eslint --quiet .","typecheck:code":"tsc --noEmit --project ./.tsconfig/code.json","typecheck:tests":"tsc --noEmit --project ./.tsconfig/tests.json","typecheck:other":"tsc --noEmit --project ./.tsconfig/other.json","typecheck":"npm run typecheck:code && npm run typecheck:tests && npm run typecheck:other","unit-test:code":"TSX_TSCONFIG_PATH=.tsconfig/tests.json node --import tsx --test 'src/**/*.test.ts'","unit-test":"npm run unit-test:code","coverage":"c8 --100 --exclude='src/**/*.test.ts' npm run test:code"},"dependencies":{"@asd14/node-utils":"^3.0.2"},"peerDependencies":{"yocto-spinner":"^1.2.0"},"peerDependenciesMeta":{"yocto-spinner":{"optional":true}},"devDependencies":{"@asd14/eslint-config":"^15.4.0","@asd14/eslint-plugin":"^3.3.0","@asd14/prettier-config":"^1.4.0","@asd14/ts-config":"^1.5.0","@commitlint/cli":"^21.0.2","@commitlint/config-conventional":"^21.0.2","@semantic-release/git":"^10.0.1","@swc/cli":"^0.8.1","@swc/core":"^1.15.41","c8":"^11.0.0","conventional-changelog-conventionalcommits":"^9.3.1","eslint":"^9.39.2","prettier":"^3.8.4","semantic-release":"^25.0.5","tsx":"^4.22.4","typescript":"^6.0.3","yocto-spinner":"^1.2.0"},"engines":{"node":">=22.12.0"},"gitHead":"012fb4f9d8729d94eb0738efe57b701110f06874","_id":"@asd14/fancy-logger@1.0.0","bugs":{"url":"https://github.com/asd-xiv/fancy-logger/issues"},"homepage":"https://github.com/asd-xiv/fancy-logger#readme","_nodeVersion":"22.22.3","_npmVersion":"11.17.0","dist":{"integrity":"sha512-AALeI0MXJ/Ks/GZQFWqp5I5xWkoitwmcGGripwnXuY2C6Qm7ITLuBYbEtzMApVObyyhoakNRXK0FwWDECK5S3Q==","shasum":"311024c9cef254f4567acd0cf37d29bf9d2d93f5","tarball":"https://registry.npmjs.org/@asd14/fancy-logger/-/fancy-logger-1.0.0.tgz","fileCount":17,"unpackedSize":34338,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCnEdr6sDXmOhx/2M4qdbrfmC2UOVng50AofS3ikuPHNgIhAPR10JsvVqwdiSVKccotg42J2IHZ/X2qX22j0PXGVoPi"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:5fe5448e-f30e-4288-97fa-ad24dee5d7b7"}},"directories":{},"maintainers":[{"name":"andreid","email":"andrei.dumitrescu@pm.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fancy-logger_1.0.0_1781509092003_0.4244520557261069"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-15T07:35:53.949Z","modified":"2026-06-15T07:38:12.296Z","0.1.0":"2026-06-15T07:35:54.304Z","1.0.0":"2026-06-15T07:38:12.148Z"},"bugs":{"url":"https://github.com/asd-xiv/fancy-logger/issues"},"author":{"name":"Andrei Dumitrescu","url":"https://github.com/andreidmt"},"license":"MIT","homepage":"https://github.com/asd-xiv/fancy-logger#readme","repository":{"type":"git","url":"git+https://github.com/asd-xiv/fancy-logger.git"},"description":"Fancy console logger for Node.js and browser","maintainers":[{"name":"andreid","email":"andrei.dumitrescu@pm.me"}],"readme":"<!-- skill: write-readme -->\n<!-- template: user-lib.md -->\n<!-- template-source: skill-default -->\n<!-- spec: - -->\n\n[![CI](https://github.com/asd-xiv/fancy-logger/actions/workflows/main.yml/badge.svg)](https://github.com/asd-xiv/fancy-logger/actions/workflows/main.yml)\n[![npm version](https://img.shields.io/npm/v/@asd14/fancy-logger.svg)](https://www.npmjs.com/package/@asd14/fancy-logger)\n\n# @asd14/fancy-logger\n\n> Fancy console logger for Node.js and browser.\n\n- **Runtime-specific entrypoints**: `@asd14/fancy-logger/node` and\n  `@asd14/fancy-logger/browser`\n- **Two output formats**: colored text for humans, JSON for log pipelines\n- **Level gating**: `error`, `warning`, `info`, `debug`\n- **Variable redaction hook**: redact variables before they leave your process\n- **Node.js extras**: animated spinner and `tadaa` banner\n\n---\n\n<!-- vim-markdown-toc GFM -->\n\n- [Install](#install)\n- [Use cases](#use-cases)\n  - [Node logs](#node-logs)\n  - [Long-running tasks (spinner)](#long-running-tasks-spinner)\n  - [Browser logs](#browser-logs)\n- [API](#api)\n  - [buildLogger](#buildlogger)\n    - [Parameters](#parameters)\n    - [Returns](#returns)\n- [Develop](#develop)\n- [Changelog](#changelog)\n\n<!-- vim-markdown-toc -->\n\n## Install\n\n```bash\n# Node apps (with spinner)\nnpm install @asd14/fancy-logger yocto-spinner\n\n# Frontend apps\nnpm install @asd14/fancy-logger\n```\n\nNode runtime requirement: `>=22.12.0`.\n\n> [!NOTE]  \n> `yocto-spinner` is an optional peer dependency used only by\n> `@asd14/fancy-logger/node` for `logger.spinner`.\n\n## Use cases\n\n### Node logs\n\n```ts\nimport { buildLogger } from \"@asd14/fancy-logger/node\"\n\nconst logger = buildLogger({\n  namespace: \"api\",\n  level: process.env[\"LOG_LEVEL\"] === \"debug\" ? \"debug\" : \"info\",\n  format: process.env[\"LOG_FORMAT\"] === \"json\" ? \"json\" : \"text\",\n  output: \"stderr\",\n})\n\nlogger.info(\"Request received\", { method: \"GET\", path: \"/users\" })\nlogger.error(\"Request failed\", { status: 500, reason: \"timeout\" })\n```\n\n### Long-running tasks (spinner)\n\n```ts\nimport { buildLogger } from \"@asd14/fancy-logger/node\"\n\nconst logger = buildLogger({ namespace: \"sync\", level: \"info\" })\n\nconst task = logger.spinner.start(\"Sync users\", { batch: 1 }, { total: 3 })\n\ntask.tick({ id: \"user-1\" })\ntask.tick({ id: \"user-2\" })\ntask.stop(\"done\")\n\nlogger.tadaa({\n  title: \"Sync complete\",\n  message: \"3 users synced\",\n  note: \"No retries\",\n})\n```\n\n### Browser logs\n\n```ts\nimport { buildLogger } from \"@asd14/fancy-logger/browser\"\n\nconst logger = buildLogger({ namespace: \"web/app\", level: \"info\" })\n\nlogger.info(\"Loaded\", { route: \"/home\" })\nlogger.tadaa({ title: \"Session ready\", message: \"MCP connected\" })\n```\n\n## API\n\n### buildLogger\n\nImport `buildLogger` from the runtime you need:\n\n```ts\nimport { buildLogger } from \"@asd14/fancy-logger/node\"\n// or\nimport { buildLogger } from \"@asd14/fancy-logger/browser\"\n```\n\n- Node entrypoint: build a Node logger with text or JSON output, a `tadaa`\n  banner, and a spinner.\n- Browser entrypoint: build a browser logger with text or JSON output.\n\n#### Parameters\n\n| Name         | Type                                                                    | Required | Default (node)                        | Default (browser) |\n| ------------ | ----------------------------------------------------------------------- | -------- | ------------------------------------- | ----------------- |\n| `namespace`  | `string`                                                                | yes      | -                                     | -                 |\n| `level`      | `\"error\" \\| \"warning\" \\| \"info\" \\| \"debug\"`                             | no       | `process.env[\"LOG_LEVEL\"] ?? \"info\"`  | `\"info\"`          |\n| `format`     | `\"text\" \\| \"json\"`                                                      | no       | `process.env[\"LOG_FORMAT\"] ?? \"text\"` | `\"text\"`          |\n| `output`     | `\"stderr\" \\| \"stdout\"`                                                  | no       | `\"stderr\"`                            | `\"stdout\"`        |\n| `redactor`   | `(input: Record<PropertyKey, unknown>) => Record<PropertyKey, unknown>` | no       | `undefined`                           | `undefined`       |\n| `thresholds` | `{ good: number; meh: number }`                                         | no       | `{ good: 100, meh: 500 }`             | -                 |\n\n#### Returns\n\n- `error(message, variables?)`\n- `warn(message, variables?)`\n- `info(message, variables?)`\n- `success(message, variables?)`\n- `debug(message, variables?)`\n- `tadaa({ title, message?, note? })`\n\nOnly on logger built from `@asd14/fancy-logger/node`:\n\n- `spinner`\n  - `start(message, variables?, { total? })`, returns a handle with:\n    - `tick(variables?)`\n    - `stop(message, variables?)`\n    - `stopError(message, variables?)`\n    - `stopWarn(message, variables?)`\n\n## Develop\n\n```bash\nnpm run lint\nnpm run typecheck\nnpm run unit-test\nnpm run build\n```\n\n## Changelog\n\nSee [releases](https://github.com/asd-xiv/fancy-logger/releases).\n","readmeFilename":"README.md"}