{"name":"@inquirer/expand","version":"4.0.5","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"],"author":"Simon Boudrias <admin@simonboudrias.com>","license":"MIT","_id":"@inquirer/expand@4.0.5","homepage":"https://github.com/SBoudrias/Inquirer.js/blob/main/packages/expand/README.md","dist":{"shasum":"af22e94be68d9ca89976ddd08ae9526a0365eb39","tarball":"http://registry-npm.ywwl.com/@inquirer/expand/download/@inquirer/expand-4.0.5.tgz","fileCount":9,"integrity":"sha512-Ff3CqHmc8MuUu9A0LKgftzIdp+D5k/kTYHGmjY7iouO37OuP6Np4UqL0clkjQ2UHph7ORwvi0RMfSNnH3PF0PQ==","signatures":[{"sig":"MEQCIEj62G+xa0lj/1VJ2+uq0oUmG3jfRqZiI9KuI3vqocDaAiA8/cHz1y9V5R0pApcm4LFspHhrIrlUalZsN0Sgiqs9kw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17880,"size":5243,"noattachment":false,"key":"/@inquirer/expand/-/@inquirer/expand-4.0.5.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":"43afbb5a1a96a23342f9fa3867e3d5d0a9abc8fe","scripts":{"tsc":"tshy","attw":"attw --pack"},"_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"repository":{"url":"https://github.com/SBoudrias/Inquirer.js.git","type":"git"},"_npmVersion":"lerna/8.1.9/node@v22.9.0+arm64 (darwin)","description":"Inquirer checkbox prompt","directories":{},"sideEffects":false,"_nodeVersion":"22.9.0","dependencies":{"@inquirer/core":"^10.1.3","@inquirer/type":"^3.0.2","yoctocolors-cjs":"^2.1.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tshy":"^3.0.2","@repo/tsconfig":"workspace:*","@inquirer/testing":"^2.1.40","@arethetypeswrong/cli":"^0.17.2"},"peerDependencies":{"@types/node":">=18"},"_npmOperationalInternal":{"tmp":"tmp/expand_4.0.5_1736626169365_0.9121348534669791","host":"s3://npm-registry-packages-npm-production"},"readme":"# `@inquirer/expand`\n\nCompact single select prompt. Every option is assigned a shortcut key, and selecting `h` will expand all the choices and their descriptions.\n\n![Expand prompt closed](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-y.svg)\n![Expand prompt expanded](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-d.svg)\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/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/expand\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/expand\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { expand } from '@inquirer/prompts';\n// Or\n// import expand from '@inquirer/expand';\n\nconst answer = await expand({\n  message: 'Conflict on file.js',\n  default: 'y',\n  choices: [\n    {\n      key: 'y',\n      name: 'Overwrite',\n      value: 'overwrite',\n    },\n    {\n      key: 'a',\n      name: 'Overwrite this one and all next',\n      value: 'overwrite_all',\n    },\n    {\n      key: 'd',\n      name: 'Show diff',\n      value: 'diff',\n    },\n    {\n      key: 'x',\n      name: 'Abort',\n      value: 'abort',\n    },\n  ],\n});\n```\n\n## Options\n\n| Property | Type                    | Required | Description                                                                               |\n| -------- | ----------------------- | -------- | ----------------------------------------------------------------------------------------- |\n| message  | `string`                | yes      | The question to ask                                                                       |\n| choices  | `Choice[]`              | yes      | Array of the different allowed choices. The `h`/help option is always provided by default |\n| default  | `string`                | no       | Default choices to be selected. (value must be one of the choices `key`)                  |\n| expanded | `boolean`               | no       | Expand the choices by default                                                             |\n| theme    | [See Theming](#Theming) | no       | Customize look of the prompt.                                                             |\n\n`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  key: string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await expand()`.\n- `name`: The string displayed in the choice list. It'll default to the stringify `value`.\n- `key`: The input the use must provide to select the choice. Must be a lowercase single alpha-numeric character string.\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n    highlight: (text: string) => string;\n  };\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","publish_time":1736626169570,"maintainers":[{"name":"sboudrias","email":"admin@simonboudrias.com"},{"name":"danielchatfield","email":"chatfielddaniel@gmail.com"},{"name":"mischah","email":"mail@michael-kuehnel.de"}],"_cnpm_publish_time":1736626169570,"dist-tags":{"latest":"5.2.0"}}