{"_id":"@codewaveds/beautify-json-log","_rev":"6-08e7d9448f90ea56fcbc2b980dcf6a31","name":"@codewaveds/beautify-json-log","dist-tags":{"latest":"1.0.1"},"versions":{"0.1.2":{"name":"@codewaveds/beautify-json-log","version":"0.1.2","author":{"name":"Mateus Tavares"},"license":"MIT","_id":"@codewaveds/beautify-json-log@0.1.2","maintainers":[{"name":"matt8741","email":"codewavedev87@gmail.com"}],"dist":{"shasum":"a0a8e7d34e141a1b15c9aaf3b190c95757294a6d","tarball":"https://registry.npmjs.org/@codewaveds/beautify-json-log/-/beautify-json-log-0.1.2.tgz","fileCount":12,"integrity":"sha512-nEfsQ4IOUWXCPwGYGteYe/j9bSnB2ap/h6pwm7m3PAQBCWvRUx3BLhZFZNQ9J2CgEXyyxLX0B4KyXsCaTKbSlA==","signatures":[{"sig":"MEYCIQC/yc/lGDTEUJgZayQd3hY51uo0VsguKHD6xuPaDxm3zgIhALNw3TzHydnYoaMTKgBmQ3BJu3FXp0IJ2XPUwuB903q/","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21641},"main":"dist/index.js","husky":{"hooks":{"pre-commit":"tsdx lint"}},"module":"dist/beautifyjsonlog.esm.js","engines":{"node":">=10"},"scripts":{"lint":"tsdx lint","size":"size-limit","test":"tsdx test --passWithNoTests","build":"tsdx build","start":"tsdx watch","deploy":"npm version patch && npm publish --access public","analyze":"size-limit --why","prepare":"tsdx build"},"typings":"dist/index.d.ts","_npmUser":{"name":"matt8741","email":"codewavedev87@gmail.com"},"prettier":{"semi":true,"printWidth":80,"singleQuote":true,"trailingComma":"es5"},"size-limit":[{"path":"dist/beautifyjsonlog.cjs.production.min.js","limit":"10 KB"},{"path":"dist/beautifyjsonlog.esm.js","limit":"10 KB"}],"_npmVersion":"10.9.2","description":"Beautify JSON log for React","directories":{},"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"devDependencies":{"tsdx":"^0.14.1","husky":"^9.1.7","react":"^19.1.0","tslib":"^2.8.1","react-dom":"^19.1.0","size-limit":"^11.2.0","typescript":"^5.8.3","@types/react":"^19.1.0","@types/react-dom":"^19.1.2","@size-limit/preset-small-lib":"^11.2.0"},"peerDependencies":{"react":">=16"},"_npmOperationalInternal":{"tmp":"tmp/beautify-json-log_0.1.2_1744306984968_0.5194413073143749","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@codewaveds/beautify-json-log","version":"0.1.3","author":{"name":"Mateus Tavares"},"license":"MIT","_id":"@codewaveds/beautify-json-log@0.1.3","maintainers":[{"name":"matt8741","email":"codewavedev87@gmail.com"}],"dist":{"shasum":"bbe45e4da32216579dfbe6b897aa393342e5adfd","tarball":"https://registry.npmjs.org/@codewaveds/beautify-json-log/-/beautify-json-log-0.1.3.tgz","fileCount":12,"integrity":"sha512-oEvvuR6m8CTO+tSS72ldFQl5euP5ybufvZbfRAhMCKlzpNVmVHnzvElzCsOllecAakFyJiTAOIzDlMgb5VOGjQ==","signatures":[{"sig":"MEYCIQDtEYtOT7LriZDFUZpsK6kTONTps8t48SAgfh6uJsGHXAIhAMNn9iol8ltZkrzPKhu7TOlwGj0JH0d3+skEo4FN4n3w","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21641},"main":"dist/index.js","husky":{"hooks":{"pre-commit":"tsdx lint"}},"module":"dist/beautifyjsonlog.esm.js","engines":{"node":">=10"},"scripts":{"lint":"tsdx lint","size":"size-limit","test":"tsdx test --passWithNoTests","build":"tsdx build","start":"tsdx watch","deploy":"npm version patch && npm publish --access public","analyze":"size-limit --why","prepare":"tsdx build"},"typings":"dist/index.d.ts","_npmUser":{"name":"matt8741","email":"codewavedev87@gmail.com"},"prettier":{"semi":true,"printWidth":80,"singleQuote":true,"trailingComma":"es5"},"size-limit":[{"path":"dist/beautifyjsonlog.cjs.production.min.js","limit":"10 KB"},{"path":"dist/beautifyjsonlog.esm.js","limit":"10 KB"}],"_npmVersion":"10.9.2","description":"Beautify JSON log for React","directories":{},"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"devDependencies":{"tsdx":"^0.14.1","husky":"^9.1.7","react":"^19.1.0","tslib":"^2.8.1","react-dom":"^19.1.0","size-limit":"^11.2.0","typescript":"^5.8.3","@types/react":"^19.1.0","@types/react-dom":"^19.1.2","@size-limit/preset-small-lib":"^11.2.0"},"peerDependencies":{"react":">=16"},"_npmOperationalInternal":{"tmp":"tmp/beautify-json-log_0.1.3_1744307719159_0.3644679020135291","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@codewaveds/beautify-json-log","version":"0.1.4","keywords":["json","log","pretty","color","devtool","debug","terminal","cli","logger","console"],"author":{"name":"Mateus Tavares"},"license":"MIT","_id":"@codewaveds/beautify-json-log@0.1.4","maintainers":[{"name":"matt8741","email":"codewavedev87@gmail.com"}],"dist":{"shasum":"b6f41df64482e2b2c9c1a560898d0398fd6b0622","tarball":"https://registry.npmjs.org/@codewaveds/beautify-json-log/-/beautify-json-log-0.1.4.tgz","fileCount":12,"integrity":"sha512-7oAq/LevoAMLvHQwygXvlQSFQGttMRxP4xOW00TqRJc0/c8p709Gany96+3rimxYz4tyr6p6O5Hxpuano8p4kQ==","signatures":[{"sig":"MEQCIFeqtx4mDZz/mfjDL5WGPawCX1gCReDiAobL1KMYdgf4AiAXZf4GnjPW6fNAkFYAt5+rNFqRpUs239Xe0xkVxMDwsA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22356},"main":"dist/index.js","husky":{"hooks":{"pre-commit":"tsdx lint"}},"module":"dist/beautifyjsonlog.esm.js","engines":{"node":">=10"},"scripts":{"lint":"tsdx lint","size":"size-limit","test":"tsdx test --passWithNoTests","build":"tsdx build","start":"tsdx watch","deploy":"npm version patch && npm publish --access public","analyze":"size-limit --why","prepare":"tsdx build"},"typings":"dist/index.d.ts","_npmUser":{"name":"matt8741","email":"codewavedev87@gmail.com"},"prettier":{"semi":true,"printWidth":80,"singleQuote":true,"trailingComma":"es5"},"size-limit":[{"path":"dist/beautifyjsonlog.cjs.production.min.js","limit":"10 KB"},{"path":"dist/beautifyjsonlog.esm.js","limit":"10 KB"}],"_npmVersion":"10.9.2","description":"Beautify JSON log for React","directories":{},"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"devDependencies":{"tsdx":"^0.14.1","husky":"^9.1.7","react":"^19.1.0","tslib":"^2.8.1","react-dom":"^19.1.0","size-limit":"^11.2.0","typescript":"^5.8.3","@types/react":"^19.1.0","@types/react-dom":"^19.1.2","@size-limit/preset-small-lib":"^11.2.0"},"peerDependencies":{"react":">=16"},"_npmOperationalInternal":{"tmp":"tmp/beautify-json-log_0.1.4_1744308521840_0.7282761290472295","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@codewaveds/beautify-json-log","version":"0.1.5","keywords":["json","log","pretty","color","devtool","debug","terminal","cli","logger","console"],"author":{"name":"Mateus Tavares"},"license":"MIT","_id":"@codewaveds/beautify-json-log@0.1.5","maintainers":[{"name":"matt8741","email":"codewavedev87@gmail.com"}],"dist":{"shasum":"74bd9d25586bfb3c630bef5d43aaa8eabfccfac2","tarball":"https://registry.npmjs.org/@codewaveds/beautify-json-log/-/beautify-json-log-0.1.5.tgz","fileCount":12,"integrity":"sha512-xDtceARsb4qQPk7WC1ZsDi4n6/REs0D/uD9mYWQ+v7bFwV5pHZmlQWZfuPCWKataiq6wj6RBD77MIYAF2yhIXw==","signatures":[{"sig":"MEQCIAHDX5wyqTrGF6b7VgU7laRbiV89QcyDKFb2MF4YrN+BAiB433sZJja06/VeBm98BrdyCu8KK7yE1vK1+tIbMXiOHA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22356},"main":"dist/index.js","husky":{"hooks":{"pre-commit":"tsdx lint"}},"module":"dist/beautifyjsonlog.esm.js","engines":{"node":">=10"},"gitHead":"ea2fbd8ab061addd58db2ff46a62d59a4c0aadce","scripts":{"lint":"tsdx lint","size":"size-limit","test":"tsdx test --passWithNoTests","build":"tsdx build","start":"tsdx watch","deploy":"npm version patch && npm publish --access public","analyze":"size-limit --why","prepare":"tsdx build"},"typings":"dist/index.d.ts","_npmUser":{"name":"matt8741","email":"codewavedev87@gmail.com"},"prettier":{"semi":true,"printWidth":80,"singleQuote":true,"trailingComma":"es5"},"size-limit":[{"path":"dist/beautifyjsonlog.cjs.production.min.js","limit":"10 KB"},{"path":"dist/beautifyjsonlog.esm.js","limit":"10 KB"}],"_npmVersion":"10.8.2","description":"Beautify JSON log for React","directories":{},"_nodeVersion":"18.20.8","_hasShrinkwrap":false,"devDependencies":{"tsdx":"^0.14.1","husky":"^9.1.7","react":"^19.1.0","tslib":"^2.8.1","react-dom":"^19.1.0","size-limit":"^11.2.0","typescript":"^5.8.3","@types/react":"^19.1.0","@types/react-dom":"^19.1.2","@size-limit/preset-small-lib":"^11.2.0"},"peerDependencies":{"react":">=16"},"_npmOperationalInternal":{"tmp":"tmp/beautify-json-log_0.1.5_1744313393456_0.33511721244929116","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@codewaveds/beautify-json-log","version":"0.1.6","keywords":["json","log","pretty","color","devtool","debug","terminal","cli","logger","console"],"author":{"name":"Mateus Tavares"},"license":"MIT","_id":"@codewaveds/beautify-json-log@0.1.6","maintainers":[{"name":"matt8741","email":"codewavedev87@gmail.com"}],"dist":{"shasum":"a8c1028134343f09875e4e75b657165f35323cb4","tarball":"https://registry.npmjs.org/@codewaveds/beautify-json-log/-/beautify-json-log-0.1.6.tgz","fileCount":12,"integrity":"sha512-1fzvmJln78tlpkacy7aB2j9gKjhrYiWTPCRXst5mL8FWdB9loZTKjp8Q6Wp/qjCFMMy15cIeLlu27xXoJ5d+Uw==","signatures":[{"sig":"MEUCIQD8H9p3UaPoMRZ+Po3y0FDiTajL+Fz6aOeqvR8lhibLzQIgPr0JqV7ZWNIUMgHavW5qHx/a0HROMu7U3Tf6a9h9avE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22356},"main":"dist/index.js","husky":{"hooks":{"pre-commit":"tsdx lint"}},"module":"dist/beautifyjsonlog.esm.js","engines":{"node":">=10"},"gitHead":"2eaaa888f3aa0893ec011d2b6f610999fcfa2d3e","scripts":{"lint":"tsdx lint","size":"size-limit","test":"tsdx test --passWithNoTests","build":"tsdx build","start":"tsdx watch","deploy":"npm version patch && npm publish --access public","analyze":"size-limit --why","prepare":"tsdx build"},"typings":"dist/index.d.ts","_npmUser":{"name":"matt8741","email":"codewavedev87@gmail.com"},"prettier":{"semi":true,"printWidth":80,"singleQuote":true,"trailingComma":"es5"},"size-limit":[{"path":"dist/beautifyjsonlog.cjs.production.min.js","limit":"10 KB"},{"path":"dist/beautifyjsonlog.esm.js","limit":"10 KB"}],"_npmVersion":"10.8.2","description":"Beautify JSON log for React","directories":{},"_nodeVersion":"18.20.8","_hasShrinkwrap":false,"devDependencies":{"tsdx":"^0.14.1","husky":"^9.1.7","react":"^19.1.0","tslib":"^2.8.1","react-dom":"^19.1.0","size-limit":"^11.2.0","typescript":"^5.8.3","@types/react":"^19.1.0","@types/react-dom":"^19.1.2","@size-limit/preset-small-lib":"^11.2.0"},"peerDependencies":{"react":">=16"},"_npmOperationalInternal":{"tmp":"tmp/beautify-json-log_0.1.6_1744313755449_0.9423693615377025","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"version":"1.0.1","license":"MIT","source":"src/index.ts","main":"dist/index.js","typings":"dist/index.d.ts","engines":{"node":">=10"},"scripts":{"start":"tsdx watch","build":"tsdx build","terminal-demo":"tsdx build && node scripts/terminal-demo.js","test":"tsdx test --passWithNoTests","lint":"tsdx lint","prepare":"tsdx build","size":"size-limit","analyze":"size-limit --why","deploy":"npm version patch && npm publish --access public"},"peerDependencies":{"react":">=16"},"husky":{"hooks":{"pre-commit":"tsdx lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"name":"@codewaveds/beautify-json-log","description":"Beautify JSON log for React","keywords":["json","log","pretty","color","devtool","debug","terminal","cli","logger","console"],"author":{"name":"Mateus Tavares"},"module":"dist/beautifyjsonlog.esm.js","size-limit":[{"path":"dist/beautifyjsonlog.cjs.production.min.js","limit":"10 KB"},{"path":"dist/beautifyjsonlog.esm.js","limit":"10 KB"}],"devDependencies":{"@size-limit/preset-small-lib":"^11.2.0","@testing-library/jest-dom":"^6.9.1","@testing-library/react":"^16.3.2","@types/react":"^19.1.0","@types/react-dom":"^19.1.2","husky":"^9.1.7","react":"^19.1.0","react-dom":"^19.1.0","size-limit":"^11.2.0","tsdx":"^0.14.1","tslib":"^2.8.1","typescript":"^5.8.3"},"_id":"@codewaveds/beautify-json-log@1.0.1","gitHead":"26c91acfa1ff35930bed1b9aaecde82e78fcc1f3","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"integrity":"sha512-f5PPS/2OJZE7VOORJC0hAVwPEbNe5chHbEuCCI5rdUhoxotJX1ZQ5dyzxciyIO7V02yuyu57P/IrOzv7hNtuOA==","shasum":"0bff86de8e43a0b7fa7414f2e3b793213bcf10cf","tarball":"https://registry.npmjs.org/@codewaveds/beautify-json-log/-/beautify-json-log-1.0.1.tgz","fileCount":28,"unpackedSize":144395,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEPYvbHrcbQI48CYcHa6BvvQtbDKwUmhZpxsBiIuc6pTAiAmDbtQSDyxnzI6VbZ8G6lvcegVpDP3jUkBDvXAjlOVZA=="}]},"_npmUser":{"name":"matt8741","email":"codewavedev87@gmail.com"},"directories":{},"maintainers":[{"name":"matt8741","email":"codewavedev87@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/beautify-json-log_1.0.1_1779291323774_0.4591602777937509"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-10T17:43:04.898Z","modified":"2026-05-20T15:35:24.068Z","0.1.2":"2025-04-10T17:43:05.128Z","0.1.3":"2025-04-10T17:55:19.361Z","0.1.4":"2025-04-10T18:08:42.024Z","0.1.5":"2025-04-10T19:29:53.637Z","0.1.6":"2025-04-10T19:35:55.707Z","1.0.1":"2026-05-20T15:35:23.918Z"},"author":{"name":"Mateus Tavares"},"license":"MIT","keywords":["json","log","pretty","color","devtool","debug","terminal","cli","logger","console"],"description":"Beautify JSON log for React","maintainers":[{"name":"matt8741","email":"codewavedev87@gmail.com"}],"readme":"# 🎨 beautify-json-log\n\nUma biblioteca para visualizar e inspecionar valores JavaScript/JSON com **realce de sintaxe por tipo**, tanto no terminal (Node.js) quanto em aplicações React.\n\n---\n\n## 📦 Instalação\n\n```bash\nnpm i -D @codewaveds/beautify-json-log\n# ou\nyarn add -D @codewaveds/beautify-json-log\n```\n\n---\n\n## Terminal\n\n```ts\nimport { BeautifyJsonLog } from '@codewaveds/beautify-json-log';\n\nBeautifyJsonLog('Meu objeto', {\n  nome: 'Alice',\n  idade: 30,\n  ativo: true,\n  score: null,\n  tags: ['admin', 'user'],\n  criado: new Date(),\n  meta: new Map([['chave', 1]]),\n  ids: new Set([1, 2, 3]),\n});\n```\n\nExibe no terminal uma visualização colorida e formatada, com suporte completo a:\n\n- 🟩 **Chaves** em verde\n- 🔠 **Strings** em azul\n- 🔢 **Números** em amarelo\n- 🔘 **Booleanos** em magenta\n- ❌ **Null / Error** em vermelho\n- 🔵 **Date / Map / Set** em ciano\n- ⚫ **undefined** em cinza\n- 🔁 **Referências circulares** detectadas e exibidas como `[Circular]`\n- 📦 **BigInt** com sufixo `n`\n\n### Opções\n\n```ts\nBeautifyJsonLog('título', valor, {\n  indent: 4,           // espaços de indentação (padrão: 2)\n  theme: meuTema,      // AnsiTheme customizado\n  transport: console.error, // onde enviar a saída (padrão: console.log)\n  plugins: [minhaTransformação], // transforma a árvore antes de renderizar\n});\n```\n\n---\n\n## React\n\n```tsx\nimport { JsonViewer } from '@codewaveds/beautify-json-log';\n\n<JsonViewer title=\"Resposta da API\" value={data} />\n```\n\n### Props\n\n| Prop | Tipo | Padrão | Descrição |\n|---|---|---|---|\n| `value` | `unknown` | — | Valor a exibir |\n| `title` | `string` | — | Título opcional acima do viewer |\n| `theme` | `CssTheme` | tema padrão (VS Code dark) | Cores CSS para cada tipo |\n| `indent` | `number` | `16` | Indentação em pixels |\n| `plugins` | `Plugin[]` | `[]` | Transforma a árvore antes de renderizar |\n| `style` | `CSSProperties` | — | Estilo do container |\n\n---\n\n## Plugins\n\nPlugins são funções que recebem o nó raiz da árvore (`RenderNode`) e retornam um nó transformado. Útil para ocultar campos sensíveis, mascarar valores, etc.\n\n```ts\nimport { BeautifyJsonLog, Plugin } from '@codewaveds/beautify-json-log';\n\nconst redact: Plugin = node => {\n  if (node.kind !== 'object') return node;\n  return {\n    ...node,\n    entries: node.entries.map(e =>\n      e.key === 'senha'\n        ? { key: e.key, value: { kind: 'primitive', valueType: 'string', raw: '\"[REDACTED]\"' } }\n        : e\n    ),\n  };\n};\n\nBeautifyJsonLog('Usuário', usuario, { plugins: [redact] });\n```\n\nO mesmo plugin funciona tanto no terminal quanto no `<JsonViewer>`.\n\n---\n\n## Temas\n\n### Terminal (AnsiTheme)\n\n```ts\nimport { BeautifyJsonLog, AnsiTheme } from '@codewaveds/beautify-json-log';\n\nconst meuTema: AnsiTheme = {\n  key: s => `\\x1b[35m${s}\\x1b[0m`,      // magenta\n  string: s => `\\x1b[33m${s}\\x1b[0m`,   // amarelo\n  number: s => `\\x1b[36m${s}\\x1b[0m`,   // ciano\n  boolean: s => `\\x1b[32m${s}\\x1b[0m`,  // verde\n  null: s => `\\x1b[31m${s}\\x1b[0m`,     // vermelho\n  undefined: s => s,\n  bigint: s => `\\x1b[36m${s}\\x1b[0m`,\n  date: s => `\\x1b[34m${s}\\x1b[0m`,\n  error: s => `\\x1b[31m${s}\\x1b[0m`,\n  bracket: s => s,\n  punctuation: s => s,\n  circular: s => `\\x1b[31m${s}\\x1b[0m`,\n  special: s => `\\x1b[34m${s}\\x1b[0m`,\n};\n\nBeautifyJsonLog('Log', dados, { theme: meuTema });\n```\n\n### React (CssTheme)\n\n```tsx\nimport { JsonViewer, CssTheme } from '@codewaveds/beautify-json-log';\n\nconst meuTema: CssTheme = {\n  key: '#c586c0',\n  string: '#ce9178',\n  number: '#b5cea8',\n  boolean: '#569cd6',\n  null: '#f44747',\n  undefined: '#808080',\n  bigint: '#b5cea8',\n  date: '#4fc1ff',\n  error: '#f44747',\n  bracket: '#d4d4d4',\n  punctuation: '#d4d4d4',\n  circular: '#f44747',\n  special: '#4fc1ff',\n};\n\n<JsonViewer value={dados} theme={meuTema} />\n```\n\n---\n\n## API\n\n```ts\n// Renderização no terminal\nBeautifyJsonLog(title: string, value: unknown, options?: LoggerOptions): void\nformatTree(node: RenderNode, options?: FormatOptions): string\nbuildTree(value: unknown): RenderNode\n\n// Componente React\n<JsonViewer value={unknown} ...props />\n\n// Tipos\ntype Plugin = (node: RenderNode) => RenderNode\ntype Transport = (output: string) => void\ntype AnsiTheme = Record<ThemeKey, (s: string) => string>\ntype CssTheme = Record<ThemeKey, string>\n```","readmeFilename":"README.md"}