{"name":"@inquirer/ansi","version":"1.0.0","keywords":["answer","answers","ask","base","cli","command","command-line","confirm","enquirer","generate","generator","hyper","input","inquire","inquirer","interface","iterm","javascript","menu","node","nodejs","prompt","promptly","prompts","question","readline","scaffold","scaffolder","scaffolding","stdin","stdout","terminal","tty","ui","yeoman","yo","zsh","ansi"],"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","_id":"@inquirer/ansi@1.0.0","maintainers":[{"name":"sboudrias","email":"admin@simonboudrias.com"},{"name":"danielchatfield","email":"chatfielddaniel@gmail.com"},{"name":"mischah","email":"mail@michael-kuehnel.de"}],"homepage":"https://github.com/SBoudrias/Inquirer.js/blob/main/packages/ansi/README.md","bugs":{"url":"https://github.com/SBoudrias/Inquirer.js/issues"},"dist":{"shasum":"29525c673caf36c12e719712830705b9c31f0462","tarball":"http://registry-npm.ywwl.com/@inquirer/ansi/download/@inquirer/ansi-1.0.0.tgz","fileCount":8,"integrity":"sha512-JWaTfCxI1eTmJ1BIv86vUfjVatOdxwD0DAVKYevY8SazeUUZtW+tNbsdejVO1GYE0GXJW1N1ahmiC3TFd+7wZA==","signatures":[{"sig":"MEYCIQDM7D0WGZryAL5Nkdtn1lGtQT0slTafYjzFiqp3Tmm7IgIhAJXlku0vmaV82TKIMwYbDToPs7rbTB8/bYyQhwFKRr3P","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7370,"size":2477,"noattachment":false,"key":"/@inquirer/ansi/-/@inquirer/ansi-1.0.0.tgz"},"main":"./dist/commonjs/index.js","tshy":{"exclude":["src/**/*.test.ts"],"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"type":"module","types":"./dist/commonjs/index.d.ts","module":"./dist/esm/index.js","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},"./package.json":"./package.json"},"gitHead":"3fdf43342deb468ee41d698e407d8800700e08dc","scripts":{"tsc":"tshy","attw":"attw --pack"},"_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"repository":{"url":"git+https://github.com/SBoudrias/Inquirer.js.git","type":"git"},"_npmVersion":"8.19.2","description":"A lightweight package providing ANSI escape sequences for terminal cursor manipulation and screen clearing.","directories":{},"sideEffects":false,"_nodeVersion":"24.5.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tshy":"^3.0.2","@repo/tsconfig":"workspace:*","@arethetypeswrong/cli":"^0.18.2"},"_npmOperationalInternal":{"tmp":"tmp/ansi_1.0.0_1757865283369_0.06939510877810018","host":"s3://npm-registry-packages-npm-production"},"readme":"# @inquirer/ansi\n\nA lightweight package providing ANSI escape sequences for terminal cursor manipulation and screen clearing.\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/ansi\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/ansi\n```\n\n</td>\n</tr>\n</table>\n\n## Usage\n\n```js\nimport {\n  cursorUp,\n  cursorDown,\n  cursorTo,\n  cursorLeft,\n  cursorHide,\n  cursorShow,\n  eraseLines,\n} from '@inquirer/ansi';\n\n// Move cursor up 3 lines\nprocess.stdout.write(cursorUp(3));\n\n// Move cursor to specific position (x: 10, y: 5)\nprocess.stdout.write(cursorTo(10, 5));\n\n// Hide/show cursor\nprocess.stdout.write(cursorHide);\nprocess.stdout.write(cursorShow);\n\n// Clear 5 lines\nprocess.stdout.write(eraseLines(5));\n```\n\nOr when used inside an inquirer prompt:\n\n```js\nimport { cursorHide } from '@inquirer/ansi';\nimport { createPrompt } from '@inquirer/core';\n\nexport default createPrompt((config, done: (value: void) => void) => {\n  return `Choose an option${cursorHide}`;\n});\n```\n\n## API\n\n### Cursor Movement\n\n- **`cursorUp(count?: number)`** - Move cursor up by `count` lines (default: 1)\n- **`cursorDown(count?: number)`** - Move cursor down by `count` lines (default: 1)\n- **`cursorTo(x: number, y?: number)`** - Move cursor to position (x, y). If y is omitted, only moves horizontally\n- **`cursorLeft`** - Move cursor to beginning of line\n\n### Cursor Visibility\n\n- **`cursorHide`** - Hide the cursor\n- **`cursorShow`** - Show the cursor\n\n### Screen Manipulation\n\n- **`eraseLines(count: number)`** - Clear `count` lines and position cursor at the beginning of the first cleared line\n\n# License\n\nCopyright (c) 2025 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","publish_time":1757865283545,"_cnpm_publish_time":1757865283545,"dist-tags":{"latest":"2.1.0"}}