{"_id":"@averagejoeslab/ansi","_rev":"2-fcf3501a95d6d8cd1438125f5823677b","name":"@averagejoeslab/ansi","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@averagejoeslab/ansi","version":"1.0.0","keywords":["ansi","terminal","escape","sequences","cursor","colors","sgr","cli"],"author":{"name":"Average Joe's Lab"},"license":"MIT","_id":"@averagejoeslab/ansi@1.0.0","maintainers":[{"name":"chasedovey","email":"chase@odovey.com"}],"homepage":"https://github.com/averagejoeslab/ansi#readme","bugs":{"url":"https://github.com/averagejoeslab/ansi/issues"},"dist":{"shasum":"59de2c2ac463c24309a79b7549ceb5b2f8f20096","tarball":"https://registry.npmjs.org/@averagejoeslab/ansi/-/ansi-1.0.0.tgz","fileCount":7,"integrity":"sha512-WyemrrO8VmQujVgN9GxZQNkda+x9UM//S3dkdhHNeVk55cMLnJQ0fzs7h4b9ol/HYc4bU+dJxWmq6Yf3Qm4j4Q==","signatures":[{"sig":"MEYCIQCj1c/yOJynaEL4Q6NJS9/i/uv4uPxDx6vNt0DLMVjQEAIhAMuFP/WLbtPR6BYVpYfbGDxCWMkgsrd3Y7IG2c6bUfrR","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":152685},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"43e9be4f3cf6d376433186003269df1efc5473f6","scripts":{"lint":"eslint src --ext .ts","test":"vitest run","build":"tsup src/index.ts --format cjs,esm --dts","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"chasedovey","email":"chase@odovey.com"},"repository":{"url":"git+https://github.com/averagejoeslab/ansi.git","type":"git"},"_npmVersion":"11.5.2","description":"ANSI escape sequence utilities for terminal applications","directories":{},"_nodeVersion":"22.16.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.1","vitest":"^1.0.0","typescript":"^5.3.0","@types/node":"^20.10.0"},"_npmOperationalInternal":{"tmp":"tmp/ansi_1.0.0_1770014865973_0.5119451365802659","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@averagejoeslab/ansi","version":"1.0.1","description":"ANSI escape sequence utilities for terminal applications","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"build":"tsup src/index.ts --format cjs,esm --dts","test":"vitest run","test:watch":"vitest","lint":"eslint src --ext .ts","prepublishOnly":"npm run build"},"keywords":["ansi","terminal","escape","sequences","cursor","colors","sgr","cli"],"author":{"name":"Average Joe's Lab"},"license":"MIT","devDependencies":{"@types/node":"^20.10.0","tsup":"^8.0.1","typescript":"^5.3.0","vitest":"^1.0.0"},"repository":{"type":"git","url":"git+https://github.com/averagejoeslab/ansi.git"},"engines":{"node":">=18"},"_id":"@averagejoeslab/ansi@1.0.1","gitHead":"43e9be4f3cf6d376433186003269df1efc5473f6","bugs":{"url":"https://github.com/averagejoeslab/ansi/issues"},"homepage":"https://github.com/averagejoeslab/ansi#readme","_nodeVersion":"22.16.0","_npmVersion":"11.5.2","dist":{"integrity":"sha512-h78uoK0IPjBBpMYMSsDm791QHXT215IZ/DarM5bEqoXOF2bgA8tmSxC+gShQZcD/bA0mCFYlOVIyfVt+LDltPA==","shasum":"12ca2dd141d4a16bb2161d86068d8c3588b4b334","tarball":"https://registry.npmjs.org/@averagejoeslab/ansi/-/ansi-1.0.1.tgz","fileCount":7,"unpackedSize":152685,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDrb8OndJPAiiJ3XY0UTNGJ63MfdzOJGMbbKKj9iQ89zwIhAPGB7C9af+U9vReGTzDFoJntLm99tlE6fdAXl1Yyu+X3"}]},"_npmUser":{"name":"chasedovey","email":"chase@odovey.com"},"directories":{},"maintainers":[{"name":"chasedovey","email":"chase@odovey.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ansi_1.0.1_1770018689221_0.29669468582703096"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-02T06:47:45.914Z","modified":"2026-02-02T07:51:29.505Z","1.0.0":"2026-02-02T06:47:46.130Z","1.0.1":"2026-02-02T07:51:29.378Z"},"bugs":{"url":"https://github.com/averagejoeslab/ansi/issues"},"author":{"name":"Average Joe's Lab"},"license":"MIT","homepage":"https://github.com/averagejoeslab/ansi#readme","keywords":["ansi","terminal","escape","sequences","cursor","colors","sgr","cli"],"repository":{"type":"git","url":"git+https://github.com/averagejoeslab/ansi.git"},"description":"ANSI escape sequence utilities for terminal applications","maintainers":[{"name":"chasedovey","email":"chase@odovey.com"}],"readme":"# @puppuccino/ansi\n\nLow-level ANSI escape code utilities for terminal applications.\n\n## Installation\n\n```bash\nnpm install @puppuccino/ansi\n```\n\nOr install from GitHub:\n\n```bash\nnpm install github:averagejoeslab/ansi\n```\n\n## Features\n\n- **Cursor Control** - Move, hide, show, save/restore cursor position\n- **Screen Control** - Clear screen, scroll, alternate buffer\n- **Text Styling (SGR)** - Bold, italic, underline, colors, and more\n- **Color Support** - 16 colors, 256 colors, and 24-bit RGB\n- **String Width** - Calculate visible width of strings with ANSI codes\n- **OSC Sequences** - Hyperlinks, window titles, notifications\n\n## Usage\n\n### Cursor Control\n\n```typescript\nimport { cursor } from '@puppuccino/ansi';\n\n// Move cursor\nprocess.stdout.write(cursor.move(10, 5));     // Move to column 10, row 5\nprocess.stdout.write(cursor.up(2));           // Move up 2 lines\nprocess.stdout.write(cursor.down(1));         // Move down 1 line\nprocess.stdout.write(cursor.forward(5));      // Move right 5 columns\nprocess.stdout.write(cursor.back(3));         // Move left 3 columns\n\n// Hide/show cursor\nprocess.stdout.write(cursor.hide);\nprocess.stdout.write(cursor.show);\n\n// Save/restore position\nprocess.stdout.write(cursor.save);\nprocess.stdout.write(cursor.restore);\n```\n\n### Screen Control\n\n```typescript\nimport { screen } from '@puppuccino/ansi';\n\n// Clear screen\nprocess.stdout.write(screen.clear);           // Clear entire screen\nprocess.stdout.write(screen.clearLine);       // Clear current line\nprocess.stdout.write(screen.clearDown);       // Clear from cursor down\n\n// Alternate buffer (for full-screen apps)\nprocess.stdout.write(screen.altBuffer);       // Enter alternate buffer\nprocess.stdout.write(screen.mainBuffer);      // Return to main buffer\n\n// Scrolling\nprocess.stdout.write(screen.scrollUp(5));     // Scroll up 5 lines\nprocess.stdout.write(screen.scrollDown(3));   // Scroll down 3 lines\n```\n\n### Text Styling (SGR)\n\n```typescript\nimport { sgr, style } from '@puppuccino/ansi';\n\n// Apply styles\nconsole.log(style.bold('Bold text'));\nconsole.log(style.italic('Italic text'));\nconsole.log(style.underline('Underlined'));\nconsole.log(style.strikethrough('Crossed out'));\n\n// Colors\nconsole.log(style.red('Red text'));\nconsole.log(style.bgBlue('Blue background'));\nconsole.log(style.rgb(255, 128, 0, 'Orange text'));\nconsole.log(style.bgRgb(0, 0, 128, 'Navy background'));\n\n// Combine styles\nconsole.log(style.bold(style.red('Bold red')));\n\n// Using SGR codes directly\nimport { SGR } from '@puppuccino/ansi';\nprocess.stdout.write(sgr(SGR.bold, SGR.fgRed) + 'Bold Red' + sgr(SGR.reset));\n```\n\n### String Width\n\n```typescript\nimport { stringWidth, stripAnsi } from '@puppuccino/ansi';\n\nconst styled = style.bold('Hello') + ' ' + style.red('World');\n\n// Get visible length (excluding ANSI codes)\nconsole.log(stringWidth(styled));  // 11\n\n// Strip all ANSI codes\nconsole.log(stripAnsi(styled));    // \"Hello World\"\n```\n\n### OSC Sequences\n\n```typescript\nimport { osc } from '@puppuccino/ansi';\n\n// Set window title\nprocess.stdout.write(osc.title('My App'));\n\n// Create hyperlink\nconsole.log(osc.link('https://example.com', 'Click here'));\n\n// Desktop notification (terminal support varies)\nprocess.stdout.write(osc.notify('Alert', 'Something happened'));\n```\n\n## API Reference\n\n### Constants\n\n- `CSI` - Control Sequence Introducer (`\\x1b[`)\n- `OSC` - Operating System Command (`\\x1b]`)\n- `SGR` - Select Graphic Rendition codes\n\n### Modules\n\n- `cursor` - Cursor movement and visibility\n- `screen` - Screen clearing and scrolling\n- `style` - Text styling with SGR codes\n- `sgr()` - Raw SGR sequence generator\n- `osc` - OSC sequence utilities\n- `stringWidth()` - Calculate visible string width\n- `stripAnsi()` - Remove ANSI codes from string\n\n## License\n\nMIT\n","readmeFilename":"README.md"}