{"_id":"@01.works/console","_rev":"4-512045a877e64a94c7d98d99fe853474","name":"@01.works/console","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@01.works/console","version":"0.1.0","license":"MIT","_id":"@01.works/console@0.1.0","maintainers":[{"name":"kdnhyk","email":"kdnhyk@gmail.com"}],"homepage":"https://github.com/01-office/console#readme","bugs":{"url":"https://github.com/01-office/console/issues"},"dist":{"shasum":"07e1413000091a5dcf9982aaca188aac8f85e58e","tarball":"https://registry.npmjs.org/@01.works/console/-/console-0.1.0.tgz","fileCount":13,"integrity":"sha512-opNZm0QxaZjzlGy+Eg7P86WpsxduPCvB+qJSQkYgDfvFO0jMPErOiIkLrcwfji2YdL1yBPrfypBdZLK8Zp74Ew==","signatures":[{"sig":"MEUCIDRrayIuW2cEm2wRLi5afcOP+nFr7Nqk5+db46C9JkL0AiEAzOtITrZnDjCmlqR63AFsNP2VLu09r6n8IZYTFQCrvN0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20753},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./react":{"types":"./dist/react.d.ts","import":"./dist/react.js","default":"./dist/react.js"},"./logger":{"types":"./dist/logger.d.ts","import":"./dist/logger.js","default":"./dist/logger.js"}},"scripts":{"test":"pnpm run build && node --test --test-concurrency=1","build":"pnpm run clean && tsc","clean":"node --input-type=module -e \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true });\"","prepare":"pnpm run build","typecheck":"tsc --noEmit","dev:playground":"pnpm -C playground run dev","prepublishOnly":"pnpm test && pnpm run typecheck"},"_npmUser":{"name":"kdnhyk","email":"kdnhyk@gmail.com"},"repository":{"url":"git+https://github.com/01-office/console.git","type":"git"},"_npmVersion":"11.12.1","description":"Shared console utilities for 01.works","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.33.0","devDependencies":{"react":"^19.2.0","react-dom":"^19.2.0","typescript":"^5.9.3","@types/react":"^19.2.0"},"peerDependencies":{"react":">=17.0.0"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/console_0.1.0_1781522685880_0.7629078449228561","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@01.works/console","version":"0.1.1","license":"MIT","_id":"@01.works/console@0.1.1","maintainers":[{"name":"kdnhyk","email":"kdnhyk@gmail.com"}],"homepage":"https://github.com/01-office/console#readme","bugs":{"url":"https://github.com/01-office/console/issues"},"dist":{"shasum":"a4b5346544b07ce2386b1f7bec4c3cf469b989f5","tarball":"https://registry.npmjs.org/@01.works/console/-/console-0.1.1.tgz","fileCount":13,"integrity":"sha512-ZqMWmLnqyUiqZwzVUn8Ymv6x4mIwXv9/RDszAvo0YUgXapXki2bqKRJOup5wnO+ujdXmvxjqHy8P7b/iKFJ3Pw==","signatures":[{"sig":"MEYCIQDz1N6uP+iJAfpCeNh1OM5o7GIZWV3VB97cMCxsYoncLQIhAOqBGBBfG6iFKIKqJguMXYBnLTZ7T6X+xkkNXZuvpjxS","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23572},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./react":{"types":"./dist/react.d.ts","import":"./dist/react.js","default":"./dist/react.js"},"./logger":{"types":"./dist/logger.d.ts","import":"./dist/logger.js","default":"./dist/logger.js"}},"scripts":{"test":"pnpm run build && node --test --test-concurrency=1","build":"pnpm run clean && tsc","clean":"node --input-type=module -e \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true });\"","prepare":"pnpm run build","typecheck":"tsc --noEmit","dev:playground":"pnpm -C playground run dev","prepublishOnly":"pnpm test && pnpm run typecheck"},"_npmUser":{"name":"kdnhyk","email":"kdnhyk@gmail.com"},"repository":{"url":"git+https://github.com/01-office/console.git","type":"git"},"_npmVersion":"11.12.1","description":"Shared console utilities for 01.works","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.33.0","devDependencies":{"react":"^19.2.0","react-dom":"^19.2.0","typescript":"^5.9.3","@types/react":"^19.2.0"},"peerDependencies":{"react":">=17.0.0"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/console_0.1.1_1781523634390_0.17607679480591965","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@01.works/console","version":"0.1.2","license":"MIT","_id":"@01.works/console@0.1.2","maintainers":[{"name":"kdnhyk","email":"kdnhyk@gmail.com"}],"homepage":"https://github.com/01-office/console#readme","bugs":{"url":"https://github.com/01-office/console/issues"},"dist":{"shasum":"e285641aa3f80bd2268664164b679bc8f5570bd5","tarball":"https://registry.npmjs.org/@01.works/console/-/console-0.1.2.tgz","fileCount":13,"integrity":"sha512-Zo8FTy8BLdLyOHnz0jeF/9AHMkxMTFlKUdYx9gdJ9UxGpWHBqh+akUis5xZa884KCIpRz3RhLufv2bnEfTztcQ==","signatures":[{"sig":"MEYCIQCiVgNG9Rq70dCaeaI20yZ7mNOKPfqb3giz9TJwyH4txwIhAMtaiUb/gHDofUkF3aT2WTlLmiGwmY/qmjpHITlPiM0U","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24171},"main":"./dist/index.js","type":"module","_from":"file:01.works-console-0.1.2.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./react":{"types":"./dist/react.d.ts","import":"./dist/react.js","default":"./dist/react.js"},"./logger":{"types":"./dist/logger.d.ts","import":"./dist/logger.js","default":"./dist/logger.js"}},"scripts":{"test":"pnpm run build && node --test --test-concurrency=1","build":"pnpm run clean && tsc","clean":"node --input-type=module -e \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true });\"","typecheck":"tsc --noEmit","dev:playground":"pnpm -C playground run dev"},"_npmUser":{"name":"kdnhyk","email":"kdnhyk@gmail.com"},"_resolved":"/private/var/folders/mr/1yy73dlx7rg_sb0x6j2hvfs80000gn/T/ae824644d38af3fe71fbe27b21f42e7f/01.works-console-0.1.2.tgz","_integrity":"sha512-Zo8FTy8BLdLyOHnz0jeF/9AHMkxMTFlKUdYx9gdJ9UxGpWHBqh+akUis5xZa884KCIpRz3RhLufv2bnEfTztcQ==","repository":{"url":"git+https://github.com/01-office/console.git","type":"git"},"_npmVersion":"11.12.1","description":"Shared console utilities for 01.works","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"react":"^19.2.0","react-dom":"^19.2.0","typescript":"^5.9.3","@types/react":"^19.2.0"},"peerDependencies":{"react":">=17.0.0"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/console_0.1.2_1781685030562_0.6451807957663966","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@01.works/console","version":"0.1.3","description":"Shared console utilities for 01.works","type":"module","packageManager":"pnpm@10.33.0","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./react":{"types":"./dist/react.d.ts","import":"./dist/react.js","default":"./dist/react.js"},"./logger":{"types":"./dist/logger.d.ts","import":"./dist/logger.js","default":"./dist/logger.js"}},"scripts":{"clean":"node --input-type=module -e \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true });\"","build":"pnpm run clean && tsc","test":"pnpm run build && node --test --test-concurrency=1","dev:playground":"pnpm -C playground run dev","typecheck":"tsc --noEmit","prepare":"pnpm run build","prepublishOnly":"pnpm test && pnpm run typecheck"},"repository":{"type":"git","url":"git+https://github.com/01-office/console.git"},"bugs":{"url":"https://github.com/01-office/console/issues"},"homepage":"https://github.com/01-office/console#readme","publishConfig":{"access":"public"},"license":"MIT","peerDependencies":{"react":">=17.0.0"},"peerDependenciesMeta":{"react":{"optional":true}},"devDependencies":{"@types/react":"^19.2.0","react":"^19.2.0","react-dom":"^19.2.0","typescript":"^5.9.3"},"_id":"@01.works/console@0.1.3","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-PiC3YoDCWO6PyAKGVkfWynuzEkBTI4n0v/k8aDJxUR3sVRSeIC49lyi/MaHpLJ8+RxCalQH38dBMiKMsLn3mZw==","shasum":"aca8a9614a65d195192b1d51a5eebe76f88625db","tarball":"https://registry.npmjs.org/@01.works/console/-/console-0.1.3.tgz","fileCount":13,"unpackedSize":24314,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIF3L5ZAevK09aJZOVbB55ZVcOeZAute2iUMavxr0lXasAiEAjbOCx8ngHTd1DiG3C6eCc8bi9OPRvgFiEqwCLsqlzIY="}]},"_npmUser":{"name":"kdnhyk","email":"kdnhyk@gmail.com"},"directories":{},"maintainers":[{"name":"kdnhyk","email":"kdnhyk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/console_0.1.3_1782319556482_0.14262306685435489"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-15T11:24:45.708Z","modified":"2026-06-24T16:45:56.733Z","0.1.0":"2026-06-15T11:24:46.038Z","0.1.1":"2026-06-15T11:40:34.534Z","0.1.2":"2026-06-17T08:30:30.701Z","0.1.3":"2026-06-24T16:45:56.611Z"},"bugs":{"url":"https://github.com/01-office/console/issues"},"license":"MIT","homepage":"https://github.com/01-office/console#readme","repository":{"type":"git","url":"git+https://github.com/01-office/console.git"},"description":"Shared console utilities for 01.works","maintainers":[{"name":"kdnhyk","email":"kdnhyk@gmail.com"}],"readme":"# @01.works/console\n\nUsable shared branding utilities for 01.works.\n\n## Installation\n\n```sh\npnpm add @01.works/console\n```\n\nFor a GitHub install before or outside npm publishing:\n\n```sh\npnpm add github:01-office/console\n```\n\n## Usage\n\n```ts\nimport { showBranding } from \"@01.works/console\";\n\nshowBranding();\n```\n\nThe package does not run automatically. The shared `showBranding()` export is a\nonce-guarded no-op by default; create an explicit bundled branding printer when\nyou want the styled developer-console message to appear. Repeated calls from the\nsame printer instance produce only one message.\n\n`showBranding()` is SSR-safe: it does not access `window` and has no import-time\nside effects.\n\n## API\n\n### `showBranding(options?: BrandingOptions): void`\n\nDefault shared branding printer. It is once-guarded and SSR-safe, but does not\nlog bundled branding unless you create a configured printer with\n`createBrandingBanner`.\n\nPass a console-compatible target when the message should use a specific logger:\n\n```ts\nshowBranding({ console: customConsole });\n```\n\n```ts\ntype BrandingOptions = {\n  console?: BrandingConsole;\n};\n\ntype BrandingConsole = Pick<Console, \"group\" | \"groupEnd\" | \"info\">;\ntype BrandingPrinter = (options?: BrandingOptions) => void;\n```\n\nTo include bundled brand banners from the core API, create an opt-in banner\nprinter. Each enabled brand logs with `console.info`: the caption, an ASCII-art\nwordmark, then the URL right-aligned on the line below the art. Banners are\nrendered in monospace (via `%c`, no color), and no console groups are used.\n\n```ts\nimport { createBrandingBanner } from \"@01.works/console\";\n\nconst show = createBrandingBanner({\n  includeWorks: true,\n  includeSoftware: true,\n});\nshow({ console: customConsole });\n```\n\n```ts\ntype BrandingBannerConfig = {\n  includeWorks?: boolean;\n  includeSoftware?: boolean;\n};\n```\n\n## Console styling\n\nThe package is a lightweight wrapper for styled browser-console output. The\nbundled 01.works and 01.software banners above are built on these primitives.\n\n```ts\nimport { badge, log, segment } from \"@01.works/console\";\n\nlog(badge(\"API\", { background: \"#0af\", color: \"#fff\" }), \" request sent\");\nlog(segment(\"hello\", \"color: hotpink; font-weight: 600\"));\n```\n\n- `segment(text, style?)` — styled text. `style` is a CSS object (camelCase\n  keys) or a raw CSS string.\n- `badge(label, style?)` — a styled label with default padding/rounding.\n- `log(...parts)` — emit styled parts (and plain strings) to the global console.\n\n### Level logger\n\n```ts\nimport { createLogger } from \"@01.works/console/logger\";\n\nconst logger = createLogger();\nlogger.info(\"loaded\");\nlogger.success(\"saved\");\nlogger.error(\"failed\", err); // extra args keep interactive inspection\n```\n\n`createLogger(options?)` accepts `{ console, levels }` to inject a console\ntarget and override per-level styles. Levels: `info`, `warn`, `error`,\n`success`, `debug`.\n\n### Custom branding\n\n```ts\nimport { createBranding } from \"@01.works/console\";\n\nconst show = createBranding({\n  groups: [{ label: \"Website by\", link: \"https://acme.com\" }],\n});\nshow({ console: customConsole });\n```\n\n`createBranding(config)` returns a once-guarded, SSR-safe `show()` function.\nCustom `groups` are separate from the bundled banner flags and use console\ngroups instead of ASCII-art banners.\n\n```ts\ntype BrandingGroup = {\n  label: string;\n  link: string;\n};\n\ntype BrandingConfig = {\n  groups: BrandingGroup[];\n};\n```\n\n## React\n\nA React entry point is available at `@01.works/console/react` for apps that\nprefer to drop branding in declaratively. React is an optional peer dependency —\nthe core entry above has no React dependency.\n\n```tsx\n// app/layout.tsx (Next.js App Router)\nimport { Branding } from \"@01.works/console/react\";\n\nexport default function RootLayout({ children }) {\n  return (\n    <html>\n      <body>\n        {children}\n        <Branding includeWorks />\n      </body>\n    </html>\n  );\n}\n```\n\n`Branding` is a renderless component (it returns `null`) that shows configured\nbranding once, after mount. It ships a `\"use client\"` directive, so it works\ninside Server Components without extra wrapping. SSR-safe: nothing is logged\nduring server rendering.\n\nPass `groups` to show custom grouped branding instead of bundled banners (any\nconsole target can still be injected with `console`):\n\n```tsx\n<Branding groups={[{ label: \"Website by\", link: \"https://acme.com\" }]} />\n```\n\nPass `includeWorks` and/or `includeSoftware` to include bundled banners:\n\n```tsx\n<Branding includeWorks />\n<Branding includeSoftware />\n<Branding includeWorks includeSoftware />\n```\n\nAll React variants accept a console-compatible target:\n\n```tsx\n<Branding includeWorks includeSoftware console={customConsole} />\n```\n\nBoth `Branding` and `useBranding` accept `BrandingProps` — the branding\n`groups`, optional `includeWorks` and `includeSoftware`, plus an optional\n`console` target. With no `groups` or bundled brand flags, nothing is logged.\nWith `groups`, each mounted component shows its configured branding once and\nbundled brand flags are ignored.\n\n```ts\ntype BrandingProps = BrandingOptions & {\n  groups?: BrandingGroup[];\n  includeWorks?: boolean;\n  includeSoftware?: boolean;\n};\n```\n\nPrefer a hook? `useBranding()` does the same thing from inside your own client\ncomponent:\n\n```tsx\n\"use client\";\nimport { useBranding } from \"@01.works/console/react\";\n\nexport function Providers({ children }) {\n  useBranding({ includeWorks: true });\n  return children;\n}\n```\n\nBoth accept the same `BrandingProps` (branding `groups`, optional\n`includeWorks` and `includeSoftware`, plus an optional `console` target).\n\n## Development\n\n```sh\npnpm test\npnpm run typecheck\npnpm pack --dry-run\n```\n","readmeFilename":"README.md"}