{"id":23034162,"url":"https://github.com/nktznl/ink","last_synced_at":"2025-10-17T10:22:41.510Z","repository":{"id":256958549,"uuid":"849006725","full_name":"nktznl/ink","owner":"nktznl","description":"Ink is a lightweight TypeScript library that allows users to create beautiful colorized console.log outputs using ANSI escape codes.","archived":false,"fork":false,"pushed_at":"2024-09-13T16:21:42.000Z","size":140,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-26T02:11:41.122Z","etag":null,"topics":["colors","js","logging","logs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@nktznl/ink","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nktznl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-28T20:00:34.000Z","updated_at":"2024-09-13T16:21:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"1c8b4ed4-44ae-44f0-b2ce-817abfd655f8","html_url":"https://github.com/nktznl/ink","commit_stats":null,"previous_names":["nikitazanella/ink"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nktznl/ink","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nktznl%2Fink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nktznl%2Fink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nktznl%2Fink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nktznl%2Fink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nktznl","download_url":"https://codeload.github.com/nktznl/ink/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nktznl%2Fink/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261984939,"owners_count":23240339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["colors","js","logging","logs"],"created_at":"2024-12-15T16:29:37.704Z","updated_at":"2025-10-17T10:22:41.497Z","avatar_url":"https://github.com/nktznl.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ink\n\n[![npm version](https://badge.fury.io/js/@nktznl/ink.svg)](https://badge.fury.io/js/@nktznl/ink)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Node.js CI](https://github.com/nktznl/ink/actions/workflows/ci.yml/badge.svg)](https://github.com/nktznl/ink/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/nktznl/ink/branch/main/graph/badge.svg)](https://codecov.io/gh/nktznl/ink)\n\nA lightweight, powerful TypeScript library for creating beautiful colorized console output with ANSI escape codes. Features chaining, themes, styles, advanced effects, and logging helpers.\n\n![Terminal Output Example](example.png)\n\n## ✨ Features\n\n- 🎨 **Color Chaining**: Chain colors and styles fluently\n- 🎭 **Text Styles**: Bold, italic, underline, dim, and more\n- 🎪 **Advanced Effects**: Rainbow, gradient, and random colors\n- 🏷️ **Themes**: Predefined themes for success, error, warning, info\n- 📝 **Logging Helpers**: Ready-to-use logging functions with icons\n- 🔧 **TypeScript**: Full TypeScript support with type definitions\n- 📦 **ESM \u0026 CJS**: Dual package support\n- ⚡ **Zero Dependencies**: Lightweight and fast\n\n## Installation\n\n```bash\nnpm install @nktznl/ink\n# or\nyarn add @nktznl/ink\n# or\npnpm add @nktznl/ink\n```\n\n## Usage\n\n### Basic Colors\n\n```js\nimport { ink } from '@nktznl/ink';\n\nconsole.log(ink.red.text('This is red text'));\nconsole.log(ink.green.text('This is green text'));\nconsole.log(ink.blue.text('This is blue text'));\n```\n\n### Bright Colors\n\n```js\nconsole.log(ink.brightRed.text('This is bright red text'));\nconsole.log(ink.brightGreen.text('This is bright green text'));\nconsole.log(ink.brightBlue.text('This is bright blue text'));\n```\n\n### Background Colors\n\n```js\nconsole.log(ink.bgRed.text('This is text with a red background'));\nconsole.log(ink.bgGreen.text('This is text with a green background'));\nconsole.log(ink.bgBlue.text('This is text with a blue background'));\n```\n\n### Text Styles\n\n```js\nconsole.log(ink.bold.text('This is bold text'));\nconsole.log(ink.italic.text('This is italic text'));\nconsole.log(ink.underline.text('This is underlined text'));\nconsole.log(ink.dim.text('This is dim text'));\n```\n\n### Combining Colors and Styles\n\n```js\nconsole.log(ink.red.bold.bgWhite.text('Red bold text on white background'));\nconsole.log(ink.brightGreen.underline.text('Bright green underlined text'));\n```\n\n### Themes\n\n```js\nimport { themes } from '@nktznl/ink';\n\nconsole.log(themes.success.text('Operation completed successfully!'));\nconsole.log(themes.error.text('An error occurred!'));\nconsole.log(themes.warning.text('This is a warning'));\nconsole.log(themes.info.text('Information message'));\n```\n\n### Logging Helpers\n\n```js\nimport { log } from '@nktznl/ink';\n\nlog.success('File uploaded successfully');\nlog.error('Failed to connect to database');\nlog.warning('Disk space running low');\nlog.info('Server started on port 3000');\nlog.debug('Processing user request');\nlog.trace('Function called with args: x=1, y=2');\n```\n\n### Advanced Effects\n\n```js\nimport { effects } from '@nktznl/ink';\n\n// Rainbow text\nconsole.log(effects.rainbow('Hello World!'));\n\n// Gradient effect\nconsole.log(effects.gradient('Gradient Text', 'red', 'blue'));\n\n// Random colors\nconsole.log(effects.random('Surprise colors!'));\n```\n\n## API Reference\n\n### `ink`\n\nThe main chaining API for colors and styles.\n\n**Available Colors:**\n- Basic: `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`, `black`\n- Bright: `brightRed`, `brightGreen`, `brightYellow`, `brightBlue`, `brightMagenta`, `brightCyan`, `brightWhite`, `brightBlack`\n- Background: `bgRed`, `bgGreen`, `bgYellow`, `bgBlue`, `bgMagenta`, `bgCyan`, `bgWhite`, `bgBlack`\n- Bright Background: `bgBrightRed`, `bgBrightGreen`, `bgBrightYellow`, `bgBrightBlue`, `bgBrightMagenta`, `bgBrightCyan`, `bgBrightWhite`, `bgBrightBlack`\n\n**Available Styles:**\n- `bold`, `dim`, `italic`, `underline`, `blink`, `reverse`, `hidden`, `strikethrough`\n\n**Methods:**\n- `.text(string)`: Apply the chained colors/styles to text\n\n### `themes`\n\nPredefined color themes.\n\n- `themes.success`: Green color\n- `themes.error`: Red color\n- `themes.warning`: Yellow color\n- `themes.info`: Blue color\n- `themes.debug`: Cyan color\n- `themes.trace`: Magenta color\n\n### `log`\n\nLogging helpers with icons.\n\n- `log.success(message)`: ✓ Success message (green)\n- `log.error(message)`: ✗ Error message (red)\n- `log.warning(message)`: ⚠ Warning message (yellow)\n- `log.info(message)`: ℹ Info message (blue)\n- `log.debug(message)`: 🔍 Debug message (cyan)\n- `log.trace(message)`: 🔗 Trace message (magenta)\n\n### `effects`\n\nAdvanced color effects.\n\n- `effects.rainbow(text)`: Apply rainbow colors to each character\n- `effects.gradient(text, startColor, endColor)`: Create gradient between two colors\n- `effects.random(text)`: Apply random colors to each character\n\n## Examples\n\nCheck out the `example/` directory for more usage examples.\n\n## Contributing\n\nContributions are welcome! Please:\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests for new features\n5. Ensure all tests pass\n6. Submit a pull request\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Run tests\nnpm test\n\n# Run linter\nnpm run lint\n\n# Format code\nnpm run format\n\n# Build\nnpm run build\n\n# Run coverage\nnpm run coverage\n```\n\n## License\n\nMIT © Nikita Zanella\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for release notes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnktznl%2Fink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnktznl%2Fink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnktznl%2Fink/lists"}